question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Student: A company offers an employee a salary of $450 per week plus a commission of 5% of their weekly sales. If the employee makes $1500 in sales one week, how much will they earn that week?
def solve() -> int: salary = 450 sales = 1500 commission = 0.05 commission_earned = sales * commission total_earnings = salary + commission_earned result = total_earnings return result
How much would it cost to buy 4 calculators at $10 each, if the tax rate is 8%?
def solve() -> int: price_per_calculator = 10 number_of_calculator = 4 tax_rate = 8 total_price = price_per_calculator * number_of_calculator * ( 1 + tax_rate / 100) result = total_price return result
Dan likes to make pancakes with milk, eggs, flour, baking powder, and butter. He uses a ratio of 1 cup of milk to 1 egg to 1 cup of flour to 1 teaspoon of baking powder to 1 tablespoon of butter. He has a 16-cup mixing bowl and a 12-inch skillet that can fit four pancakes at a time. He also has a 2-cup measuring cup, a...
def solve() -> int: milk_per_pancake = 1 / 4 egg_per_pancake = 1 / 4 flour_per_pancake = 1 / 4 powder_per_pancake = 1 / 4 butter_per_pancake = 1 / 4 milk_available = 4 egg_available = 12 flour_available = 5 * 2 powder_available = 4 * 6 butter_available = 16 * 2 ...
``` A company has 200 employees. If they want to divide them into teams of 10 people each, how many teams will they have?
def solve() -> int: number_of_teams = 200 / 10 result = number_of_teams return result
David bought a bike for $240 and later sold it for $360. What was his profit?
def solve() -> int: original_price = 240 selling_price = 360 profit = selling_price-original_price result = profit return result
A file of 75 megabytes in size downloads at the rate of 6.3 megabytes per second for its first 25 megabytes, and then 10 megabytes per second thereafter. How long, in seconds, does it take to download entirely?
def solve() -> int: download_time = 0 first_half = 25 * 6.3 * 1024**2 second_half = (75 - 25) * 10 * 1024**2 total_bytes = first_half + second_half download_time += 25 * 6.3 download_time += (75 - 25) * 10 result = download_time return result
A school has 150 boys and 100 girls. If half of the boys and one-third of the girls went on a field trip, how many students went on the field trip?
def solve() -> int: number_of_boys = 150 number_of_girls = 100 boys_on_fieldtrip = number_of_boys / 2 girls_on_fieldtrip = number_of_girls / 3 total_on_fieldtrip = boys_on_fieldtrip + girls_on_fieldtrip result = total_on_fieldtrip return result
A store bought 60 shirts for $2400. The store then sold each shirt for $50. How much profit did the store make?
def solve() -> int: cost_per_shirt = 2400/60 revenue_per_shirt = 50 profit_per_shirt = revenue_per_shirt - cost_per_shirt profit = profit_per_shirt * 60 result = profit return result
Ryan uses 1/4 cup of butter and 3/4 cup of flour to make 12 biscuits. How much butter and flour does he need to make 36 biscuits?
def solve() -> int: butter_per_biscuit = 1/4 / 12 flour_per_biscuit = 3/4 / 12 butter_needed = butter_per_biscuit * 36 flour_needed = flour_per_biscuit * 36 butter_needed = round(butter_needed, 2) flour_needed = round(flour_needed, 2) result = butter_needed, flour_needed ...
Alex has 3 kinds of candies. He eats one-fourth of the first kind, gives away half of the remainder to his sister, and eats two out of three pieces of the remaining candy. He does the same with the second kind of candy and half of the third kind of candy leaving with 2 pieces in the end. How many candies did Alex have ...
def solve() -> int: num_candy_third = 2 num_candy_second = 2*(3 / 2) * (2 / 3) * 3 num_candy_first = 2 * (4 / 3) * (2 / 3) * num_candy_second total_candies = num_candy_first + num_candy_second + num_candy_third result = total_candies return result
In a carnival, there are 40 ferris wheel carts. If each cart has 2 seats, how many people can ride the ferris wheel at the same time?
def solve() -> int: num_carts = 40 num_seats_per_cart = 2 total_num_seats = num_carts * num_seats_per_cart result = total_num_seats return result
Student: Jill bought 7 t-shirts at the store, each shirt was $13. She received a 20% discount on her purchase. How much money did Jill save?
def solve() -> int: t_shirts = 7 price = 13 discount = 0.2 original_cost = t_shirts * price discount_amount = original_cost * discount final_cost = original_cost - discount_amount saved = discount_amount result = saved return result
A restaurant prepares dishes with varying amounts of meat. Recently, many customers have been ordering dishes with less meat and the restaurant is wasting some of the meat that they buy. To reduce costs and waste, the restaurant starts monitoring how much meat is being used and changes their purchasing accordingly. If ...
def solve() -> int: meat_dish_old = 2 veg_dish_old = 1 meat_dish_new = 15 veg_dish_new = 40 total_meat_old = meat_dish_old * 20 + veg_dish_old * 10 total_meat_new = meat_dish_new * 15 + veg_dish_new * 1 meat_saved = total_meat_old - total_meat_new result = meat_saved ...
Jake's weekly earnings are $750 and he spends $65 on food. He also puts away 20% of his income as savings. How much money does Jake have left?
def solve() -> int: income = 750 food = 65 savings = income * 0.2 leftover = income - savings - food result = leftover return result
arah has some furniture to move. On the first day, she moves 3 chairs, 5 tables, and 1 shelf. On the second day, she moves 4 chairs, 7 tables, and 2 shelves. How many items has she moved in total?
def solve() -> int: total = 0 total += 3 total += 5 total += 1 total += 4 total += 7 total += 2 result = total return result
A company calculates its employees' salaries by adding an hourly rate and an overtime rate if they work more than 40 hours per week. If John worked for 45 hours and his hourly rate is $15, and overtime rate is twice his hourly rate, how much did he get paid?
def solve() -> int: hourly_rate = 15 overtime_rate = hourly_rate*2 hours_worked = 45 if hours_worked>40: pay = (40*hourly_rate) + ((hours_worked-40)*overtime_rate) else: pay = hours_worked*hourly_rate result = pay return result
Tim babysat for a family and earned $30 the first night. The next night he earned 25% more than the first night and the next night he earned 30% more than the first night. How much money did Tim earn in total?
def solve() -> int: earnings1 = 30 earnings2 = earnings1 * 1.25 earnings3 = earnings1 * 1.30 result = earnings1 + earnings2 + earnings3 return result
Student: Jane drives at a speed of 40 miles per hour when she is alone, but drives at 50 miles per hour when her husband is in the car with her. If they drive together for 1 hour and they travel 45 miles, how long did Jane drive alone?
def solve() -> int: speed_alone = 40 speed_together = 50 time_together = 1 distance = 45 time_alone = (distance - (time_together * speed_together)) / speed_alone result = time_alone return result
Possible new questions and programs: Jacob is making lemonade for a picnic. He needs 8 cups of water and 1 cup of lemon juice for each pitcher of lemonade. He has a 4-quart jug of water and a 12-ounce bottle of lemon juice. How many pitchers of lemonade can he make with what he has?
def solve() -> int: quarts_to_cups = 4 ounces_to_cups = 1 / 8 water_cups = 4 * quarts_to_cups lemon_cups = 12 * ounces_to_cups pitcher_water = 8 pitcher_lemon = 1 water_pitchers = water_cups // pitcher_water lemon_pitchers = lemon_cups // pitcher_lemon min_pitchers = min(water_pitche...
A car can drive 10 kilometers on 1 liter of gas. If it has a 40 liter gas tank, how many kilometers can it drive on a full tank?
def solve() -> int: km_per_liter = 10 gas_tank = 40 distance_per_tank = km_per_liter * gas_tank result = distance_per_tank return result
You are planning a barbecue party and it was assigned to your uncle to bring the burgers. Each pack of burgers contains 8 pieces and costs $7. You invited 40 guests and each guest will eat 2 burgers. If you and your cousins need to split the cost, how much would each person pay?
def solve() -> int: num_guests = 40 num_burgers = num_guests * 2 num_packs = num_burgers // 8 + (num_burgers % 8 > 0) total_cost = num_packs * 7 num_people = 1 + len(['cousin1', 'cousin2', 'cousin3']) cost_per_person = total_cost / num_people result = cost_per_p...
7. There are 500 marbles in the jar and Nathan took out 2 fifth of them to play marbles. He then threw away 7 marbles and kept the rest in the jar. How many marbles are still in the jar?
def solve() -> int: num_marbles = 500 num_taken = round(num_marbles * 2/5) num_left = num_marbles - num_taken num_thrown = 7 result = num_left - num_thrown return result
A factory can produce 80 units per hour. Another factory can produce 120 units per 2 hours. If they work together, how long will it take them to produce 1000 units?
def solve() -> int: rate_factory1 = 80 rate_factory2 = 120/2 rate_working_together = rate_factory1 + rate_factory2 time_working_together = 1000/rate_working_together result = time_working_together return result
A pizza costs $12.50, and it is shared by 4 people equally. How much does each person have to pay?
def solve() -> int: pizza_cost = 12.50 num_people = 4 cost_per_person = pizza_cost / num_people result = cost_per_person return result
A recipe for cookies requires 3 cups of flour for 24 cookies. How many cups of flour are needed for 36 cookies?
def solve() -> int: ratio = 3 / 24 flour = ratio * 36 result = flour return result
Rick is reading an eight-chapter book with 288 pages. Each chapter has six pages more than the previous one. How many pages does the first chapter have?
def solve() -> int: total_pages = 288 chapter_count = 8 additional_pages = 6 initial_chapter_pages = (2 * total_pages - chapter_count * (chapter_count - 1) * additional_pages) // (2 * chapter_count) result = initial_chapter_pages return result
A bookcase contains 15 books and there are 5 different genres represented equally. How many books belong to each genre?
def solve() -> int: genres = 5 books_per_genre = 15/genres result = books_per_genre return result
Andy buys 3 books and 2 pencils at a bookstore. The books cost $12 each and the pencils cost $0.5 each. He pays with a $50 bill and gets a 5% discount for being a loyal customer. How much change does he get?
def solve() -> int: books = 3 pencils = 2 book_price = 12 pencil_price = 0.5 bill = 50 discount = 0.05 cost_books = books * book_price cost_pencils = pencils * pencil_price cost_total = cost_books + cost_pencils cost_discounted = cost_total * (1 - discount) change =...
Sam collects stamps and sells them online. He bought a collection of 120 stamps for $240. He sold 80 of them for $3 each and the rest for $2 each. How much money did Sam make from selling the stamps?
def solve() -> int: cost_bought = 240 num_bought = 120 price_high = 3 num_high = 80 price_low = 2 num_low = num_bought - num_high revenue = price_high * num_high + price_low * num_low profit = revenue - cost_bought result = profit return result
David got a bag of 25 candies. 6 of them were gummies and twice as many were hard candies. The number of mints equals to the number of gummies. The remaining candies were sour. David picks a candy at random. What percentage chance will it be sour candy?
def solve() -> int: candies = 25 gummies = 6 hard_candies = 2 * gummies mints = gummies sour_candies = candies - (gummies + hard_candies + mints) total_candies = candies sour_chance = (sour_candies / total_candies) * 100 result = sour_chance return result
Sam has 6 times as many marbles as Jane. Sam then loses 18 marbles in a game. If Jane has 3 marbles, how many does Sam have left?
def solve() -> int: sam = 6 * 3 jane = 3 sam = sam - 18 result = sam return result
Kevin had some bottles of water for his soccer team. He gave 2 bottles to each of the 12 players and had 8 bottles left for himself. Then he drank 3 bottles during the game and gave away 2 more bottles to the other team. How many bottles of water did Kevin have to start with and how many did he have left at the end of ...
def solve() -> int: players = 12 bottles_per_player = 2 bottles_left = 8 bottles_given = players * bottles_per_player bottles_start = bottles_given + bottles_left bottles_drank = 3 bottles_shared = 2 bottles_used = bottles_drank + bottles_shared bottles_end = bott...
John wants to drive from city A to city B, which is 120 miles apart. He drives at a constant speed of 60 miles per hour for the first 80 miles, and then slows down to 40 miles per hour for the remaining distance. What is his average speed for the entire trip?
def solve() -> int: time_1 = 80/60 time_2 = 40/40 total_time = time_1 + time_2 total_distance = 120 average_speed = total_distance/total_time result = average_speed return result
A rectangle has a length of 8 cm and a width of 6 cm. What is its perimeter?
def solve() -> int: length = 8 width = 6 perimeter = 2*length + 2*width result = perimeter return result
A taxi charges $5 for the first mile and $2 for each additional mile. If Mark travels 10 miles, how much does he pay?
def solve() -> int: total_distance = 10 first_mile_price = 5 additional_mile_price = 2 if total_distance > 1: additional_distance = total_distance - 1 total_price = first_mile_price + (additional_distance * additional_mile_price) else: total_price = first_mile_price resul...
Mia swims 4 miles per hour. She swims for 30 minutes on Monday, 45 minutes on Tuesday, 1 hour on Wednesday, and 15 minutes on Thursday. If she wants to swim 15 miles for the week, how many hours should she swim on Friday?
def solve() -> int: distance = 4 * (0.5 + 0.75 + 1 + 0.25) remaining = 15 - distance time = remaining / 4 result = time return result
Tyler has six boxes of 11 balls, three boxes of 9 balls, and two boxes of 8 balls. How many balls does Tyler have in total?
def solve() -> int: boxA = 11 boxB = 9 boxC = 8 numA = 6 numB = 3 numC = 2 totalA = boxA * numA totalB = boxB * numB totalC = boxC * numC result = totalA + totalB + totalC return result
Student: Emma has 25 candies, 5 more than Sophie and 10 less than Ethan. How many candies does Ethan have?
def solve() -> int: sophie_candies = 25 - 5 ethan_candies = sophie_candies + 10 result = ethan_candies return result
A bookshelf has 5 shelves. Each shelf can accommodate 7 books. A pile of books contains 30 books. How many books will be left over after all shelves are filled in?
def solve() -> int: total_shelves = 5 books_per_shelf = 7 total_books = 30 books_that_fit = total_shelves * books_per_shelf books_left = total_books % books_that_fit result = books_left return result
A square has a perimeter of 48 inches. What is the area of the square?
def solve() -> int: perimeter = 48 side_length = perimeter/4 area = side_length**2 result = area return result
A restaurant has a stock of 150 plates. On a particular day, 3 guests order 30 plates and 20 more plates are ordered on the second day. How many plates are left in the stock after the second day?
def solve() -> int: plates_in_stock = 150 plates_ordered_day1 = 30 plates_ordered_day2 = 20 plates_left = plates_in_stock - plates_ordered_day1 - plates_ordered_day2 result = plates_left return result
A pet store sold 18 dogs on the first day. On the second day, 5 dogs were returned and 2 times as many were sold compared to the first day. On the third day, 10 dogs were sold and only 1 was returned. How many dogs were sold in total?
def solve() -> int: day1 = 18 day2_returned = 5 day2_sold = 2 * day1 - day2_returned day3_sold = 10 day3_returned = 1 total_sold = day1 + day2_sold + day3_sold - day2_returned - day3_returned result = total_sold return result
Susan wants to divide her land into two rectangular plots of land. The first plot is to be 3 times as long as it is wide and the second plot is to be 4 times as long as it is wide. The combined area of the plots is to be 220 square meters. What is the perimeter in meters of the first plot of land?
def solve() -> int: area = 220 first_ratio = 3 second_ratio = 4 x = 2 total_ratio = first_ratio + second_ratio first_length = first_ratio/total_ratio first_width = 1/first_length second_length = second_ratio/total_ratio second_width = 1/second_length first_area = area*(first_rat...
Avery is trying to save their allowance. They start by saving $5 a week. The second week, they save twice as much and an extra $2. The third week, they only save 3/10 as much as they saved the second week. The week after that, they get a raise and save $7 more per week. How much did they save the week after their raise...
def solve() -> int: week1_saving = 5 week2_saving = (week1_saving * 2) + 2 week3_saving = week2_saving * (3/10) week4_saving = week3_saving + 7 result = week4_saving return result
Mike believed he had 70 ducks on his farm, but upon closer inspection, he realized that some of them were actually geese. If the number of geese was 4 times the number of ducks, how many geese did he have?
def solve() -> int: ducks = 70 geese = 4 * ducks total_animals = ducks + geese geese = total_animals - ducks result = geese return result
Jim needs to paint a wall that is 10 meters long and 4 meters high. If each can of paint covers 20 square meters of wall, how many cans of paint does Jim need to buy?
def solve() -> int: wall_length = 10 wall_height = 4 paint_coverage = 20 wall_area = wall_length * wall_height num_cans = wall_area / paint_coverage result = num_cans return result
A farmer has a field that is 80 feet long and 60 feet wide. What is the total area of the field in square feet?
def solve() -> int: length = 80 width = 60 total_area = length * width result = total_area return result
A shopkeeper earns a profit of 20% on a camera which costs him $125. What is the selling price of the camera?
def solve() -> int: cost_price = 125 profit_percentage = 0.2 selling_price = cost_price + (cost_price * profit_percentage) result = selling_price return result
Josh is cycling a distance of 45 miles in 2 hours. How many miles does Josh cycle per hour?
def solve() -> int: distance = 45 time = 2 speed = distance/time result = speed return result
A garden center sells tomato plants for $3 each and rose plants for $5 each. Yesterday, they sold 50 tomato plants and 20 rose plants. How much money did they earn?
def solve() -> int: num_tomatoes = 50 num_roses = 20 price_tomatoes = 3 price_roses = 5 total_earnings = (num_tomatoes * price_tomatoes) + (num_roses * price_roses) result = total_earnings return result
Anna prepares 36 bowls of soup and then pours them equally into smaller bowls, which she then divides into eighths. She then gives everyone 12 portions. How many people can she serve?
def solve() -> int: num_bowls = 36 num_smaller_bowls = num_bowls * 8 total_portions = num_smaller_bowls * 8 num_people = total_portions // 12 result = num_people return result
Ben and Lisa start saving money together. If Ben saves $20 every day and Lisa saves $30 every other day, how much money will they have in 6 months?
def solve() -> int: ben_savings_per_day = 20 lisa_savings_per_day = 15 days_in_6_months = 6*30 ben_savings_total = ben_savings_per_day*days_in_6_months lisa_savings_total = lisa_savings_per_day*(days_in_6_months//2) total_savings = ben_savings_total + lisa_savings_total result = total_sav...
Student: Jane has 24 stickers and she gives 1/3 of them to her friend. Then she buys 12 more stickers. How many stickers does she have now?
def solve() -> int: stickers_original = 24 stickers_given = stickers_original / 3 stickers_bought = 12 stickers_total = stickers_original - stickers_given + stickers_bought result = stickers_total return result
A garden center typically sells 25 potted plants and 20 bags of soil each day. Today, they sold 30 potted plants and 22 bags of soil. If a potted plant costs $10 and a bag of soil costs $5, what is the difference, in dollars, between the garden center’s daily average and total for today?
def solve() -> int: potted_plants_sold = 30 bags_of_soil_sold = 22 potted_plant_cost = 10 bag_of_soil_cost = 5 daily_average = (25 * potted_plant_cost + 20 * bag_of_soil_cost) / 2 total_today = potted_plants_sold * potted_plant_cost + bags_of_soil_sold * bag_of_soil_cost difference...
John buys 5 packs of notebooks for $7 per pack. Each pack consists of 20 notebooks. If he sells each notebook for $0.50, how much money will he make?
def solve() -> int: num_packs = 5 cost_per_pack = 7 num_notebooks_per_pack = 20 selling_price_per_notebook = 0.50 total_cost = num_packs * cost_per_pack total_num_notebooks = num_packs * num_notebooks_per_pack total_revenue = total_num_notebooks * selling_price_per_notebook profit = tota...
An online store offers a 20% discount on all items over $50. If Anne buys a dress for $60, how much will she pay after the discount?
def solve() -> int: original_price = 60 discount_percent = 0.20 threshold_price = 50 if original_price > threshold_price: discount = original_price*discount_percent discounted_price = original_price - discount else: discounted_price = original_price result = round(discounted_pr...
A factory has 4 machines that operate with different cycle times. Machine A has a cycle time of 20 seconds, machine B has a cycle time of 30 seconds, machine C has a cycle time of 40 seconds, and machine D has a cycle time of 50 seconds. If all the machines are started at the same time, what is the shortest time after ...
def solve() -> int: cycle_time_A = 20 cycle_time_B = 30 cycle_time_C = 40 cycle_time_D = 50 lcm = cycle_time_A while (lcm % cycle_time_B!= 0 or lcm % cycle_time_C!= 0 or lcm % cycle_time_D!= 0): lcm += cycle_time_A result = lcm return result
A store is having a 25% discount on all items. If an item originally costs $50, what will be the final price of the item (rounded to the nearest cent)?
def solve() -> int: original_price = 50 percent_off = 25 percent_to_decimal = percent_off / 100 discount = percent_to_decimal * original_price final_price = original_price - discount rounded_price = round(final_price, 2) result = rounded_price return result
At a charity event, Helen and Sarah are selling cupcakes. Between them, they have made 60 cupcakes. Sarah has three times as many chocolate cupcakes as Helen. Both of them have equal numbers of vanilla cupcakes. If Helen has made 8 vanilla cupcakes, how many chocolate cupcakes has Sarah made?
def solve() -> int: helen_vanilla = 8 helen_chocolate = (60 - helen_vanilla) / 4 sarah_vanilla = helen_vanilla sarah_chocolate = 3 * helen_chocolate result = sarah_chocolate return result
A laundry detergent bottle holds 64 fluid ounces and you need to fill up a container with 120 fluid ounces. How many bottles will you need to use to fill up the container?
def solve() -> int: bottle_size = 64 container_size = 120 bottles_needed = container_size // bottle_size + (container_size % bottle_size > 0) result = bottles_needed return result
Student: A store is having a 25% off sale. If a shirt is originally $20, how much is it now?
def solve() -> int: original_price = 20 discount = 0.25 discount_amount = original_price * discount sale_price = original_price - discount_amount result = sale_price return result
John has 3 times as many marbles as Lisa. If Lisa has 10 marbles, how many marbles does John have?
def solve() -> int: lisa_marbles = 10 john_marbles = 3 * lisa_marbles result = john_marbles return result
Student: Susan had a 9 inch cake and cut it into 12 pieces. She ate 3 pieces and then gave 40% of the remaining pieces to her family. How many pieces does Susan have left?
def solve() -> int: cake_size = 9 num_pieces = 12 pieces_eaten = 3 remaining_pieces = num_pieces - pieces_eaten pieces_given_away = int(remaining_pieces * 0.4) pieces_left = remaining_pieces - pieces_given_away result = pieces_left return result
Student: At a picnic, the ratio of adults to children was 4/7, and there were 140 guests in total. How many adults attended the picnic?
def solve() -> int: ratio_adults_to_children = 4/7 total_guests = 140 number_of_adults = ratio_adults_to_children * total_guests result = number_of_adults return result
Newell has 14 liters of paint left over from an old project. He wants to know how many buckets of paint he will get from that amount. Each bucket is 5 liters.
def solve() -> int: paint_amount = 14 bucket_size = 5 num_buckets = paint_amount / bucket_size result = num_buckets return result
Possible questions and programs: The product of the heights of four friends is 3600 cm. If three of them are 120 cm, 150 cm, and 100 cm tall, how tall is the fourth friend?
def solve() -> int: h = 3600 / (120 * 150 * 100) result = h return result
A circle has a radius of 10 centimeters. What is the circumference of the circle?
def solve() -> int: circumference = 2 * 3.14 * 10 result = circumference return result
Tom has a rectangular prism made of silver that measures 4 inches by 9 inches by 11 inches. A cubic inch of silver weighs 6.5 ounces. Each ounce of silver sells for $35. He sells it for 115% of its silver value. How much does he sell it for?
def solve() -> int: silver_weight = 4*9*11*6.5 silver_value = silver_weight * 35 total_sell = silver_value * 1.15 result = total_sell return result
Rachel wants to buy a new pair of shoes. If the shoes cost $80 and she has saved $50, how much more money does she need to save?
def solve() -> int: money_needed = 80 - 50 result = money_needed return result
If a bottle of shampoo costs $8 and is on sale for 30% off, how much is the discounted price?
def solve() -> int: original_price = 8 discount = 0.30 discounted_price = original_price * (1 - discount) result = discounted_price return result
A square has a perimeter of 20cm. What is the length of one side of the square?
def solve() -> int: perimeter = 20 side_length = perimeter/4 result = side_length return result
2. On Monday, Kim sold 34 apples and 24 oranges. On Tuesday, she sold 10 more apples and twice as many oranges as on Monday. How many oranges did Kim sell on Tuesday?
def solve() -> int: apples_on_monday = 34 oranges_on_monday = 24 apples_on_tuesday = 44 oranges_extra = oranges_on_monday * 2 oranges_on_tuesday = oranges_on_monday + oranges_extra result = oranges_on_tuesday return result
Alice wants to buy a book that costs 15 euros. Alice has 110 francs, and there are 6.5 francs to a euro. How many francs will Alice have left after buying the book?
def solve() -> int: euros = 110 // 6.5 francs = 110 % 6.5 euros = euros - 15 francs = euros * 6.5 + francs result = francs return result
Mira bought a dress online for $75 and paid $10 for shipping. She decided to return the dress because it did not fit her well. The online store refunded her the full price of the dress but charged her a $5 restocking fee and did not refund the shipping cost. How much money did Mira lose in this transaction, in dollars?
def solve() -> int: dress = 75 shipping = 10 fee = 5 paid = dress + shipping refunded = dress - fee loss = paid - refunded result = loss return result
Possible new questions with corresponding python programs are: A team of 12 people wanted to buy some pizzas for their party. Each pizza had 8 slices and cost $12. If everyone ate the same number of slices and the team spent a total of $144 on pizzas, how many slices did each person eat?
def solve() -> int: num_pizzas = 144 // 12 num_slices = num_pizzas * 8 slices_per_person = num_slices // 12 result = slices_per_person return result
The total cost of a party consists of invites, decorations and food. If the ratio of cost for invites, decorations and food is 2:3:4 respectively, and the total cost is $450. How much did the food cost?
def solve() -> int: total_cost = 450 food_ratio = 4 total_ratio = (2 + 3 + 4) cost_of_food = total_cost * (food_ratio/total_ratio) result = cost_of_food return result
Max had a container of 50 chips to share with his friends. Two-fifths of the chips were regular flavor, and the rest were equal amounts of sour cream and onion, salt and vinegar, and barbecue. How many chips were salt and vinegar?
def solve() -> int: regular_flavor = 50 * 2/5 other_flavors = 50 - regular_flavor salt_vinegar = other_flavors / 3 result = salt_vinegar return result
A company produces 5000 units per day. They want to increase production by 20%. How many units will they produce per day after the increase?
def solve() -> int: original_production = 5000 percentage_increase = 0.20 new_production = original_production + (original_production * percentage_increase) result = new_production return result
Mark wants to buy 6 16-ounce bottles of soda. The regular store charges $4 per bottle. At the bulk store, a case of 24 16-ounce bottles costs $16. How much money does he save by purchasing the case?
def solve() -> int: num_bottles = 6 regular_price = 4 bulk_price = 16 bulk_quantity = 24 regular_total = num_bottles * regular_price bulk_total = bulk_price savings = regular_total - bulk_total result = savings return result
In a Sports shop, 40% of jumpers are blue, 25% are red and the rest are grey. If there are 480 jumpers, how many of them are grey?
def solve() -> int: totalNumJumpers = 480 blueNum = totalNumJumpers * 0.4 redNum = totalNumJumpers * 0.25 GreyNum = totalNumJumpers - blueNum - redNum result = GreyNum return result
If a store sells a shirt for $25 and a pair of pants for $35, how much will it cost to buy 2 shirts and 3 pairs of pants?
def solve() -> int: cost = 2*25 + 3*35 result = cost return result
A car travels at a constant speed of 60 miles per hour for 2.5 hours, then slows down to 40 miles per hour for 1.5 hours, and then stops for 0.5 hours. What is the average speed, in miles per hour, of the car for the entire trip?
def solve() -> int: distance_60 = 60 * 2.5 distance_40 = 40 * 1.5 distance_0 = 0 * 0.5 total_distance = distance_60 + distance_40 + distance_0 total_time = 2.5 + 1.5 + 0.5 average_speed = total_distance / total_time result = average_speed return result
helly has a cake that she needs to cut into 12 equal pieces. She has already cut the cake 4 times. How many more cuts does she need?
def solve() -> int: initial_cut = 4 total_pieces = 12 additional_cut = total_pieces - initial_cut result = additional_cut return result
arah wants to buy a book that costs $20. She has saved $12 so far. How much more does she need to save to buy the book?
def solve() -> int: book_cost = 20 current_savings = 12 amount_needed = book_cost - current_savings result = amount_needed return result
Eric earned 12.5 dollars per hour for working 4 hours on each of 5 Fridays, and 15 dollars per hour for working 3 hours on each of 4 Saturdays. How many more dollars did he earn on Saturdays than Fridays?
def solve() -> int: total_fridays = 12.5 * 4 * 5 total_saturdays = 15 * 3 * 4 difference = total_saturdays - total_fridays result = difference return result
A swimmer can swim 100m in 2 minutes. After swimming for 1 hour and 30 minutes, the swimmer takes a 10-minute break. How far can the swimmer swim in 4 hours and 15 minutes?
def solve() -> int: m_per_hour = (60 / 2) * 100 hours_of_swimming = 4.25 - (1.5 + (10/60)) m_of_swimming = hours_of_swimming * m_per_hour result = m_of_swimming return result
A car rental company charges 20 more dollars per day for a sedan than for a compact car. If the daily rate for a compact car is 40 dollars, how much will it cost to rent a sedan and a compact car for 5 days each?
def solve() -> int: sedan_rate = 40 + 20 compact_rate = 40 days_sedan = 5 days_compact = 5 cost_sedan = sedan_rate * days_sedan cost_compact = compact_rate * days_compact total_cost = cost_sedan + cost_compact result = "It will cost " + str(total_cost) + " dollars to ...
Sarah goes to the gym every day from Monday to Friday and burns 300 calories. On Saturday, she burns 200 more calories, and on Sunday, she burns 500 calories. How many calories does Sarah burn every week?
def solve() -> int: weekdays = 5 calories_weekdays = 300 calories_saturday = calories_weekdays + 200 calories_sunday = 500 total_calories = (weekdays * calories_weekdays) + calories_saturday + calories_sunday result = total_calories return result
A classroom has 37 chairs. Each row can seat 7 students. What is the number of rows in the classroom?
def solve() -> int: num_chairs = 37 chairs_per_row = 7 num_rows = num_chairs // chairs_per_row result = num_rows return result
A company's revenue from the sale of products is equal to the product of the number of items sold and the price per item. If the company sold 500 items at $20 each, what was the revenue from the sales?
def solve() -> int: items_sold = 500 price_per_item = 20 revenue = items_sold * price_per_item result = revenue return result
Emma needs five times as many cups of vegetables to make her vegetable soup as she needs cups of chicken broth. If she uses 10 cups of chicken broth, how many cups of vegetables does she need?
def solve() -> int: broth = 10 vegetables = 5 * broth result = vegetables return result
Student: There were 2400 pens in a school, 1/2 were given out in the morning, and 4/5 were given out in the afternoon. How many pens were left in the school at the end of the day?
def solve() -> int: pens_in_school = 2400 pens_given_out_morning = 1/2 * pens_in_school pens_given_out_afternoon = 4/5 * pens_in_school pens_left_in_school = pens_in_school - pens_given_out_morning - pens_given_out_afternoon result = pens_left_in_school return result
Rachel wants to buy 4 bags of chips at $1.25 each and 2 candy bars at $0.75 each. How much did she spend in all?
def solve() -> int: chips_cost = 1.25 candy_bar_cost = 0.75 num_chips = 4 num_candy_bars = 2 total_cost = (chips_cost * num_chips) + (candy_bar_cost * num_candy_bars) result = total_cost return result
A digital clock showed 10:35. Five hours and 20 minutes later, it shows what time?
def solve() -> int: start_hours = 10 start_minutes = 35 total_minutes = start_hours * 60 + start_minutes + 5 * 60 + 20 final_hours = total_minutes // 60 final_minutes = total_minutes % 60 result = str(final_hours) + ":" + str(final_minutes) return result
Lisa has a rectangular garden that measures 12 m by 8 m. She wants to put a fence around the garden, leaving a 1 m gap for the entrance. The fence costs $15 per meter. How much will she spend on the fence?
def solve() -> int: perimeter = 2*(12+8) fence = perimeter - 1 cost = fence*15 result = cost return result
If John bought 6 apples for every 2 oranges he bought and paid $25 for 12 oranges and apples total, how much did he pay for one apple?
def solve() -> int: oranges_price = 25 / 12 apples_price = 3 * oranges_price result = apples_price return result
Question 10:A grocery store sells milk for $3.50 per gallon, bread for $2 per loaf, and eggs for $1.50 per dozen. If Joe buys 2 gallons of milk, 3 loaves of bread, and 1 dozen eggs, how much does she spend in total including tax, if the tax rate is 10%?
def solve() -> int: num_milk_gallons = 2 num_bread_loaves = 3 num_eggs_dozen = 1 milk_cost_per_gallon = 3.50 bread_cost_per_loaf = 2 eggs_cost_per_dozen = 1.5 tax_rate = 0.1 subtotal = num_milk_gallons*milk_cost_per_gallon + num_bread_loaves*bread_cost_per_loaf + num_eggs_dozen*eggs_cost...
Emma had 60 stickers in her album. She gave 9 stickers to her brother, 12 stickers to her sister, and 15 stickers to her cousin. Then, she bought 24 more stickers from the store and added them to her album. How many stickers did Emma have in her album after buying more stickers?
def solve() -> int: total_gave_away = 9 + 12 + 15 total_left = 60 - total_gave_away total_after_buying = total_left + 24 result = total_after_buying return result
Liam's rabbit has a tail that's one-third the length of its body, and a head that's 1/7 the length of its body. If the rabbit is 20 inches long overall, how long is its tail?
def solve() -> int: body_length = 20 tail_length = body_length / 3 result = tail_length return result
Jane has $1 coin, $2 coins and $5 coins. How much money does Jane have in total?
def solve() -> int: coin_1 = 1 coin_2 = 2 coin_5 = 5 total_amount = coin_1 + coin_2*2 + coin_5*5 result = total_amount return result