question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A car starts at a speed of 0km/h and accelerates at a rate of 2km/h^2. How much time does it take for the car to reach a speed of 20km/h?
def solve() -> int: initial_speed = 0 acceleration_rate = 2 final_speed = 20 time = (final_speed - initial_speed) / acceleration_rate result = time return result
Derek has a choice of buying a $460 camera which is 15% off or a $420 camera which is 12% off. How much money does he save by buying the cheaper camera?
def solve() -> int: camera1 = 460 discount1 = 0.15 camera1_discounted = camera1 * (1 - discount1) camera2 = 420 discount2 = 0.12 camera2_discounted = camera2 * (1 - discount2) if camera1_discounted < camera2_discounted: saved_money = camera2 - camera2_discounted else: sav...
A baker has 5 dozen cookies. He sells 3/4 of them and gives away 20. If he has 100 cookies left, how many cookies did he bake originally?
def solve() -> int: cookies_left = 100 fraction_sold = 3/4 cookies_given_away = 20 cookies_baked = (cookies_left + cookies_given_away) / (1 - fraction_sold) result = cookies_baked return result
There are 200 students in a school. If 65% of them can swim, but then 15 students transfer to another school, what percentage of students can swim now?
def solve() -> int: students = 200 swim_students = students * 0.65 students_left = students - 15 percentage_swim = swim_students / students_left * 100 result = percentage_swim return result
Student: Tony and his friend each have equal amounts of marbles. Tony's marbles can fit into 17 bags while his friend's marbles can fit into 7 bags. How many more bags will Tony need to store his marbles?
def solve() -> int: tony_marbles = 17 friend_marbles = 7 bag_capacity = tony_marbles / friend_marbles tony_extra_bags = tony_marbles - friend_marbles tony_extra_marbles = tony_extra_bags * bag_capacity tony_total_bags = tony_extra_bags + friend_marbles result = tony_total_bags ret...
Student: Jason sold 11 computers, 19 covers and 3 laptops. How many objects did he sell?
def solve() -> int: computers = 11 covers = 19 laptops = 3 total_objects = computers + covers + laptops result = total_objects return result
John has a rectangular garden. The garden is 10 meters long and 5 meters wide. He wants to build a fence around the garden. How many meters of fencing does John need?
def solve() -> int: length = 10 width = 5 perimeter = 2 * (length + width) result = perimeter return result
Six years ago, Rachel purchased a computer for $2000. The same computer will be worth double in 10 years. What will be the worth of the computer in 10 years?
def solve() -> int: year1 = 6 year2 = 10 price1 = 2000 multiplier = 2 price2 = price1*(multiplier**year2)/(multiplier**year1) result = price2 return result
Ivan drives 12 mph slower than Susan. Susan drives 36 mph. How fast does Ivan drive if she catches up to Susan in 3 hours?
def solve() -> int: susan = 36 ivan = susan - 12 time = 3 distance = susan * time ivan_speed = distance / time result = ivan_speed return result
Student: Chris and his family spent their vacation in a hotel for two weeks. They paid $1000 per week for the suite and an additional fee of $50 for the first week and $40 for the second one. How much money did Chris and his family spent in the end?
def solve() -> int: suite_cost = 1000 first_week_fee = 50 second_week_fee = 40 weeks = 2 suite_total = suite_cost * weeks fees_total = first_week_fee + second_week_fee total = suite_total + fees_total result = total return result
Kathy drove a total of 230 miles in one day. She drove 55 miles in the morning, 45 miles at noon, and 130 miles in the afternoon. How many miles did she drive in the afternoon?
def solve() -> int: distance_morning = 55 distance_noon = 45 distance_afternoon =130 total_distance = 230 result = distance_afternoon return result
A plant nursery has 50 geraniums. The number of petunias is 3 times the number of geraniums. There are 10 fewer begonias than petunias. The number of marigolds is twice the number of begonias. How many plants are there in total?
def solve() -> int: geraniums = 50 petunias = 3 * geraniums begonias = petunias - 10 marigolds = 2 * begonias total_plants = geraniums + petunias + begonias + marigolds result = total_plants return result
A store sells a shirt for $25. If the store offers a 10% discount, what is the sale price?
def solve() -> int: original_price = 25 discount = 0.1 sale_price = original_price * (1 - discount) result = sale_price return result
During a sale, shirts are being sold at a discount of 25%. A shirt originally costs $40. How much does the shirt cost after the discount?
def solve() -> int: original_price = 40 discount = 0.25 new_price = original_price * (1 - discount) result = new_price return result
A rectangle has a length of 8 cm and a width of 5 cm. What is its perimeter and area?
def solve() -> int: length = 8 width = 5 perimeter = 2*length + 2*width area = length * width result = (perimeter, area) return result
A carpenter purchased a stack of wood planks that was advertised as being 10 feet long, but they were only 9 feet long. If the carpenter needed 180 feet of planks, how many actual planks did they need to purchase?
def solve() -> int: stack_length = 10 actual_length = 9 total_length_needed = 180 planks_needed = total_length_needed/(actual_length/stack_length) result = planks_needed return result
Student: Jeff wants to put 15 boxes on a shelf. If each box takes up two blocks of space, calculate the number of blocks of space required for Jeff to put all the boxes on the shelf.
def solve() -> int: number_of_boxes = 15 blocks_per_box = 2 total_blocks = number_of_boxes * blocks_per_box result = total_blocks return result
Jeff bought a used surfboard for $90 and a bag of wax for $8. How much did he spend in total for these items?
def solve() -> int: surfboard = 90 wax = 8 totalPayment = surfboard + wax result = totalPayment return result
Student: In a flower shop, the price of roses is $6 per bouquet and the minimum spend is $40 before tax. The roses are taxed at $0.80 per bouquet. If Olivia paid $224 for roses, by how many bouquets has Olivia's purchase exceeded the minimum spend?
def solve() -> int: price_per_bouquet = 6 tax_per_bouquet = 0.8 minimum_spend = 40 total_paid = 224 total_bouquets = total_paid / (price_per_bouquet + tax_per_bouquet) total_cost = total_bouquets * price_per_bouquet result = total_bouquets - (minimum_spend / price_per_bouquet) return re...
Emma can solve a math problem in 5 minutes and a physics problem in 8 minutes. How long will it take her to solve 2 math problems and 3 physics problems?
def solve() -> int: math_problem_time = 5 physics_problem_time = 8 total_time = (2 * math_problem_time) + (3 * physics_problem_time) result = total_time return result
In a bag, there are 5 red balls, 3 blue balls, and 2 green balls. If two balls are drawn at random, what is the probability that both balls will be blue?
def solve() -> int: total_balls = 10 total_blue_balls = 3 first_blue_probability = total_blue_balls / total_balls second_blue_probability = (total_blue_balls - 1) / (total_balls - 1) both_blue_probability = first_blue_probability * second_blue_probability result = both_blue_probability retur...
A store has 200 boxes of pencils. If each box contains 24 pencils, how many pencils are there in total?
def solve() -> int: num_boxes = 200 pencils_per_box = 24 total_pencils = num_boxes * pencils_per_box result = total_pencils return result
A store sells a shirt for $25 and a pair of pants for $35. If a customer spends more than $100, they get a 10% discount. If a customer buys 2 shirts and 1 pair of pants, how much will they pay?
def solve() -> int: shirt_cost = 25 * 2 pants_cost = 35 total_cost = shirt_cost + pants_cost if total_cost > 100: discount_amount = total_cost * 10/100 total_cost = total_cost - discount_amount result = total_cost return result
David bought 50 meters of ribbon. If he needs to cut the ribbon into pieces that are 10 centimeters each, how many pieces will he have left?
def solve() -> int: length_each_piece = 10/100 num_meters_ribbon = 50 result = num_meters_ribbon / length_each_piece return result
If a store is having a 20% off sale and a shirt is originally $30, how much will it cost during the sale?
def solve() -> int: original_price = 30 percentage_off = 20 discount = original_price * percentage_off / 100 sale_price = original_price - discount result = sale_price return result
Carol bought 9 umbrellas and 5 watches for $540. If an umbrella costs $20, how much does each watch cost?
def solve() -> int: unit_price_umbrella = 20 total_price = 540 total_umbrellas = 9 total_watches = 5 total_price_with_umbrella = total_price - total_umbrellas * unit_price_umbrella unit_price_watch = total_price_with_umbrella / total_watches result = unit_price_watch ret...
Student: Pam had a 10 km bike ride. After that, she took a break for 30 minutes running 3 km. How many more kilometers did she have to ride?
def solve() -> int: bike_ride = 10 running = 3 total_distance = bike_ride + running result = total_distance - bike_ride return result
Karim has some money in his bank account. He withdraws a third of the amount and buys a new shirt. He then withdraws half of the remaining money and puts it in another account. If he has $36 left, how much money, in dollars, did he have at first?
def solve() -> int: total = 36 withdraw_1 = total / 3 left_1 = total - withdraw_1 withdraw_2 = left_1/2 left_2 = left_1 - withdraw_2 result = left_2 + withdraw_1 + withdraw_2 return result
Frank is painting a wall that is 12 feet high and 16 feet wide. He can paint 8 square feet of wall per hour. How many hours will it take him to paint the entire wall?
def solve() -> int: height = 12 width = 16 paint_rate = 8 area = height * width time = area / paint_rate result = time return result
Possible new questions and programs are: Katie wants to buy some ice cream for her friends. She has $20 and each ice cream cone costs $2.50. She also needs to pay a $3 delivery fee. How many ice cream cones can she buy?
def solve() -> int: money_left = 20 - 3 cones = money_left / 2.5 cones = int(cones) result = cones return result
Student: Kevin likes to jog and skate for exercise, and he has two different exercise routines. On Saturdays, he jogs at 4 miles per hour. On Sundays, he skates at 8 miles per hour. On each exercise day, he travels 3 miles. How many more minutes does he spend jogging than skating in a week?
def solve() -> int: jog_speed = 4 skate_speed = 8 distance = 3 jog_time = distance / jog_speed * 60 skate_time = distance / skate_speed * 60 time_difference = jog_time - skate_time total_time_difference = time_difference * 7 result = total_time_difference return result
ophia is 18 years old, and her cousin is 4 times her age. Her father is three fourths her cousin's age, and her mother is 15 years younger than her father. How old will Sophia's mother be when Sophia is 30 years old?
def solve() -> int: sophia_age = 18 sophia_cousin_age = 4 * sophia_age sophia_father_age = (3 * sophia_cousin_age) // 4 sophia_mother_age = sophia_father_age - 15 years_passed = 30 - sophia_age sophia_mother_future_age = sophia_mother_age + years_passed result = sophia_mother_future_age ...
Jackson and Liam receive $12 from their dad. Jackson spends half of his money on a new skateboard and Liam spends 5/6 of his money on a pair of sneakers. How much money do Jackson and Liam have left altogether, in dollars and cents?
def solve() -> int: jackson_money = 12/2 liam_money = 12 - jackson_money liam_money = liam_money - (5/6)*liam_money total_money = jackson_money + liam_money result = round(total_money, 2) return result
Lily is baking cookies for her friends. She needs three cups of flour, two cups of sugar, one cup of butter, and four eggs to make one batch of cookies. She has nine cups of flour, six cups of sugar, four cups of butter, and twelve eggs in her kitchen. How many batches of cookies can she make with the ingredients she h...
def solve() -> int: flour_needed = 3 sugar_needed = 2 butter_needed = 1 eggs_needed = 4 flour_available = 9 sugar_available = 6 butter_available = 4 eggs_available = 12 batches_with_flour = flour_available // flour_needed batches_with_sugar = sugar_available // sugar_needed ...
Result: 90 A clothing store sells 100 shirts in a week. The following week, they sell 120% more shirts than the previous week. What was the total amount of shirts sold in two weeks?
def solve() -> int: week1_sales = 100 week2_sales = week1_sales * 2.2 total_sales = week1_sales + week2_sales result = total_sales return result
If Lucy is 5 years younger than Max, and Max is 30 years old, how old is Lucy?
def solve() -> int: max_age = 30 lucy_age = max_age - 5 result = lucy_age return result
A boat travels 60 miles upstream in 6 hours. The return trip downstream takes 4 hours. What is the speed of the boat in still water, and what is the speed of the current?
def solve() -> int: distance = 60 time1 = 6 time2 = 4 upstream_speed = distance/time1 downstream_speed = distance/time2 boat_speed = (upstream_speed + downstream_speed)/2 current_speed = (downstream_speed - boat_speed) result = (boat_speed, current_speed) return result
James travels 120 miles by car and 80 miles by train. The car uses 1 gallon of gas for every 30 miles and the train ticket costs $0.10 per mile. How much does James spend on transportation?
def solve() -> int: gas_rate = 1 / 30 price_of_gas = 3 cost_of_car = 120 * gas_rate * price_of_gas ticket_price = 0.10 cost_of_train = 80 * ticket_price total_cost = cost_of_car + cost_of_train result = f'James spends ${total_cost} on transportation.' result = total_cost return...
A bag of candy contains 5 red candies, 7 blue candies, and 8 green candies. If one candy is randomly selected, what is the probability that it will be blue?
def solve() -> int: total_candies = 5 + 7 + 8 num_blue_candies = 7 probability_of_blue = num_blue_candies/total_candies result = probability_of_blue return result
Student: Ahmed bought 40 kilograms of flour for his bakery. He used three-fifths of it for scones, one-sixth of it for croissants, and one-ninth of the remaining flour for cupcakes. How many kilograms of flour are left after making those three kinds of cakes?
def solve() -> int: total_flour = 40 scones_ratio = 3/5 croissants_ratio = 1/6 cupcakes_ratio = 1/9 scones_flour = total_flour * scones_ratio croissants_flour = total_flour * croissants_ratio flour_left = total_flour - scones_flour - croissants_flour cupcakes_flour = flour_left * ...
A cake recipe calls for 3/4 cups of sugar and 1/3 cups of flour. If Jane wants to double the recipe, how much sugar and flour will she need in cups?
def solve() -> int: sugar_needed = (3/4)*2 flour_needed = (1/3)*2 result = round(sugar_needed + flour_needed, 2) return result
If y varies inversely with x and y = 10 when x = 5, calculate y when x = 8.
def solve() -> int: y1 = 10 x1 = 5 x2 = 8 y2 = (x1 * y1)/x2 result = f'<<<{y2}>>>' result = y2 return result
Rachel has 45 pencils. She wants to make 3 equal pencil pouches for school, but can only find 2 pouches. How many pencils will she have in each pouch now and how many pencils remain?
def solve() -> int: pencils_per_pouch = 45//3 pouches_left = 2 pencils_remain = 45%3 * pouches_left pencils_per_pouch_new = (45 - pencils_remain) // 2 result = (pencils_per_pouch_new, pencils_remain) return result
A group of friends went to a restaurant and ordered 4 appetizers, 6 entrees, and 3 desserts. If the cost of each appetizer is $5, each entree is $12, and each dessert is $7.50, what is the total cost of their meal?
def solve() -> int: appetizer_cost = 5 entree_cost = 12 dessert_cost = 7.5 num_appetizers = 4 num_entrees = 6 num_desserts = 3 total_cost = (appetizer_cost * num_appetizers) + (entree_cost * num_entrees) + (dessert_cost * num_desserts) result = total_cost return result
If a baby elephant weighs 1,000 pounds and it weighs 286 pounds more than a rhinoceros and 158 pounds less than a hippopotamus, what is the average weight of the baby elephant, rhinoceros, and hippopotamus in pounds? Emma, Ashley, and Megan collect stamps. Emma had 50 stamps before she gave Ashley 5 stamps. Ashley had ...
def solve() -> int: elephant_weight = 1000 rhino_weight = elephant_weight - 286 hippo_weight = elephant_weight + 158 average_weight = (elephant_weight + rhino_weight + hippo_weight) / 3 result = average_weight Emma_stamps = 50 Ashley_stamps = Emma_stamps - 5 Megan_stamps =...
A box of chocolates weighing 3kg costs $36. What is the cost of 1kg of chocolates?
def solve() -> int: total_weight = 3 total_cost = 36 cost_of_1kg = total_cost / total_weight result = cost_of_1kg return result
If David paid $15 for a pair of socks, which costs one-third of the price of a pair of shoes, and got a 10% discount on the shoes, calculate the total amount he spent.
def solve() -> int: socks_price = 15 shoes_price = socks_price * 3 discount = 0.10 discounted_shoes_price = shoes_price - (shoes_price * discount) total_amount_spent = socks_price + discounted_shoes_price result = total_amount_spent return result
A car traveled a distance of 180 km in 3 hours. If it travels the remaining distance in 2 hours, what is the total distance?
def solve() -> int: first_distance = 180 first_time = 3 first_speed = first_distance / first_time second_time = 2 second_distance = first_speed * second_time total_distance = first_distance + second_distance result = total_distance return result
Jack has 8 apples and wants to buy twice as many. Each apple costs $0.50, but there is a sale of buy one get one free. How much are all the apples Jack will have after the purchase worth with the discount?
def solve() -> int: original_apples = 8 discount_percentage = 50 additional_apples = original_apples * 2 original_cost_per_apple = 0.50 num_free = additional_apples/2 cost_before_discount = (original_apples + additional_apples - num_free) * original_cost_per_apple discount_amount = cost_befo...
If a train travels at 75 miles per hour, how long will it take to travel a distance of 150 miles?
def solve() -> int: speed = 75 distance = 150 time = distance / speed result = time return result
Student: Hank is building a circular garden path around his garden bed. The radius of the garden is 10 feet and the path will be 3 feet wide. How many square feet of path will he need to purchase?
def solve() -> int: pi = 3.14159 radius = 10 width = 3 outer_radius = radius + width area_outer_circle = pi * outer_radius ** 2 area_inner_circle = pi * radius ** 2 area_path = area_outer_circle - area_inner_circle result = area_path return result
A sale offers a 20% discount on all items. If a laptop costs $800 before the sale, what is the new sale price of the laptop?
def solve() -> int: original_price = 800 percent_off = 0.2 discount = original_price * percent_off sale_price = original_price - discount result = sale_price return result
Olivia received a promotion that increased her salary by 50% to $7500 per year. Mike's salary last year was three times Olivia's current pay. If Mike's salary increased by 15% this year, what is his new salary?
def solve() -> int: olivia_salary = 7500 mike_salary_last_year = 3 * olivia_salary mike_salary_increase = 0.15 * mike_salary_last_year mike_new_salary = mike_salary_last_year + mike_salary_increase result = mike_new_salary return result
am has twice as many apples as John. John has 4 apples. How many apples does Sam have?
def solve() -> int: johnApples = 4 samApples = johnApples * 2 result = samApples return result
Student: A pizza costs $12 with no toppings. Each topping costs $1.50. If a customer orders a pizza with 3 toppings and the store has a 10% off deal for orders over $15, how much will the pizza cost?
def solve() -> int: pizza_cost = 12 topping_cost = 1.50 total_cost = pizza_cost + (3 * topping_cost) discounted_cost = total_cost * 0.9 result = round(discounted_cost, 2) return result
Mr. Yang paid $20000 for his wine collection. Six years later, he sold it for a 50% profit and paid a 6% commission to the auction house from the initial cost. What was the selling price for the wine collection?
def solve() -> int: initial_cost = 20000 profit = initial_cost * 0.5 selling_price = initial_cost + profit commission = initial_cost * 0.06 net_profit = profit - commission final_price = selling_price - commission result = final_price return result
Q1: Mia got a gift of 5 additional subscribers to her new Twitch Channel. Now she has a total of 160 subscribers and makes $9 a month per subscriber. How much money will Mia make a month?
def solve() -> int: subscribers = 160 price_per_subscriber = 9 result = subscribers * price_per_subscriber return result
Isabella has a jar with 19 marbles. She wants to divide them equally among 5 buckets. How many marbles does Isabella need for each bucket?
def solve() -> int: total_marbles = 19 buckets = 5 marbles_per_bucket = total_marbles / buckets result = 3.8 return result
A football team played 16 games this season. They won 7 games, lost 5 games, and tied the rest. What percentage of their games did they win?
def solve() -> int: games_won = 7 games_lost = 5 games_tied = 16 - games_won - games_lost percent_won = (games_won/16)*100 result = percent_won return result
There are two cans of juice. One can has a volume of 250 milliliters and the other can has a volume of 500 milliliters. If both cans are poured into a glass, how many milliliters of juice are in the glass?
def solve() -> int: can1_volume = 250 can2_volume = 500 total_volume = can1_volume + can2_volume result = total_volume return result
Student: Charlie bought a toy train set that was 20% off. The original price was $125. How much money did Charlie save?
def solve() -> int: original_price = 125 discount = 0.2 discount_amount = original_price * discount saved_money = discount_amount result = saved_money return result
David has a rectangular garden that measures 15 meters by 8 meters. He wants to build a fence around the garden, but he needs to leave a 2-meter-wide gate on one side. How many meters of fencing does he need?
def solve() -> int: perimeter = 2 * (15 + 8) gate = 2 fence = perimeter - gate result = float(fence) return result
Jane deposit $500 in a savings account that pays 5% per annum simple interest. What is the total interest earned at the end of the first year?
def solve() -> int: balance = 500 interest_rate = 0.05 interest_earned = balance * interest_rate result = interest_earned return result
Grace celebrated her graduation with a live band that charged $200 an hour for 6 hours. She also rented a karaoke machine for half the time that cost 5 times as much an hour. Everything else for the party cost $1200. What was the totIn the bake sale, Sarah sold 180 cupcakes. After 30 minutes, 1/4 of the total number of...
def solve() -> int: live_band_cost = 200 * 6 karaoke_cost = 5 * 200 * 3 / 2 other_cost = 1200 total_cost = live_band_cost + karaoke_cost + other_cost total_cupcakes_sold = 180 * 1/4 + 2 * (180 * 1/4) cupcakes_unsold = 180 - total_cupcakes_sold result = cupcakes_...
Yesterday, Marie ran a total of 10 kilometers at the park. Her friend ran 4 kilometers per day for three days. They both ran the same distance. On average, how much farther did Marie run per day compared to her friend?
def solve() -> int: marie_total_distance = 10 friend_distance_per_day = 4 friend_total_distance = friend_distance_per_day * 3 marie_distance_per_day = (marie_total_distance - friend_total_distance) / 1 difference = marie_distance_per_day - friend_distance_per_day result = difference ...
Mary can fill up her tank with 30 liters of gas. She drove her car for three days and used 10 liters each day. How much gas does Mary have left?
def solve() -> int: usedgas = 10 days = 3 gassize = 30 totusedgas = usedgas * days leftgas = gassize - totusedgas result = leftgas return result
At a restaurant, 40% of the customers order a drink, 50% order a main course, and 20% order both. If 100 people dine at the restaurant, how many do not order either a drink or main course?
def solve() -> int: total_customers = 100 drink = 0.4*total_customers main_course = 0.5*total_customers both = 0.2*total_customers neither = total_customers - (drink + main_course - both) result = neither return result
A toy seller needs to sell 50 toys at $20 per toy to make $250 in profit. The seller bought the toys for $14 each. What is the total cost of buying the toys?
def solve() -> int: total_cost = 50*14 total_revenue = 50*20 total_profit = total_revenue - total_cost result = total_cost return result
If 5 red dress shirts cost $100, how much will 3 red dress shirts cost?
def solve() -> int: shirts = 3 cost = 100 price_per_shirt = cost / 5 result = shirts * price_per_shirt return result
Tony wants to buy a new computer monitor that costs $250. He has a coupon that gives him a 15% discount. The state tax is 8%. How much should he pay in total?
def solve() -> int: price_of_monitor = 250 discount = 0.15 price_after_discount = price_of_monitor * (1 - discount) tax = 0.08 total_price = price_after_discount * (1 + tax) result = total_price return result
A toy store has 90 stuffed animals to display in the window. Each shelf can hold five animals stacked vertically and 12 sets of vertically stacked animals side-by-side. How many shelves does the toy store need to display all the animals?
def solve() -> int: num_animals = 90 animals_per_shelf = 5 sets_per_shelf = 12 animals_per_set = animals_per_shelf * sets_per_shelf num_shelves = num_animals / animals_per_set result = num_shelves return result
Natalie decided to have a custom-designed wedding dress. The designer needs to charge a $750 fee for designing and making the dress. She also charges $100 per hour for 10 hours of sewing. The designer will only charge 75% of the cost for sewing because Natalie is a new customer. How much does Natalie pay for the dress?
def solve() -> int: design_fee = 750 sewing_hours = 10 sewing_rate = 100 sewing_discount = 0.75 sewing_cost = sewing_hours * sewing_rate sewing_cost_discounted = sewing_cost * sewing_discount total_cost = design_fee + sewing_cost_discounted result = total_cost return r...
To cover a distance of 465 km, a truck travelled 5 hours at a certain speed and remaining distance at a speed of 75 km/hr. Find the speed of the truck for the first part of the journey.
def solve() -> int: total_time = 7 total_distance = 465 speed_part2 = 75 time_part2 = (total_distance - (5 * speed_part2))/speed_part2 time_part1 = total_time - time_part2 speed_part1 = total_distance/time_part1 - speed_part2 result = speed_part1 return result
A company has 40 employees and they are asked to work from home due to the pandemic. However, only half of the workers actually show up. How many workers are working from home?
def solve() -> int: working_from_home = 40/2 result = round(working_from_home) return result
A museum has 10 rooms. Each room has 50 paintings. An average person takes 5 minutes to observe a painting. How long would it take to look at all the paintings in the museum?
def solve() -> int: rooms = 10 paintings_per_room = 50 time_per_painting = 5 total_paintings = rooms * paintings_per_room total_time = total_paintings * time_per_painting result = total_time return result
Adam drives 60 miles per hour, and it takes him 3 hours to drive from New York to Boston. How many miles is the trip?
def solve() -> int: distance = 60 * 3 result = distance return result
Three kids collect leaves for a nature project. They collected a total of 350 leaves. John had twice as many leaves as Hina, and Hina had 25 more leaves than Linda. How many leaves did each kid collect?
def solve() -> int: total_leaves = 350 john_leaves = total_leaves / 2 hina_leaves = john_leaves - 25 linda_leaves = hina_leaves - 25 result = "John collected {0} leaves, Hina collected {1} leaves and Linda collected {2} leaves".format(john_leaves, hina_leaves, linda_leaves) ...
Student: A restaurant charges $15 for a meal. If they have a 20% discount, what is the new price for the meal?
def solve() -> int: meal_price = 15 discount_percentage = 20 discount_amount = meal_price * (discount_percentage/100) new_price = meal_price - discount_amount result = new_price return result
A restaurant sold 150 hamburgers in one day, each for $5. If they made a profit of 40% on each hamburger, how much profit did they make?
def solve() -> int: hamburger_price = 5 num_hamburgers = 150 profit_percentage = 40 cost_per_hamburger = hamburger_price / (1+(profit_percentage/100)) total_cost = cost_per_hamburger * num_hamburgers total_revenue = hamburger_price * num_hamburgers profit = total_revenue - total_cost res...
Here are some possible questions and programs: A car rental company charges $25 per day plus $0.15 per mile for renting a car. Sam rented a car for four days and drove 320 miles. How much did he pay in total?
def solve() -> int: daily_fee = 25 * 4 mileage_fee = 0.15 * 320 total_cost = daily_fee + mileage_fee result = total_cost return result
A cat’s tail is one-third of its body length. If a cat is 24 inches long, what is the length of its body without the tail?
def solve() -> int: body_length = 24 * 3 / 4 tail_length = 24 * 1 / 4 result = body_length - tail_length return result
Student: A train travels a distance of 500 km in 5 hours. If the speed of the train is increased by 20 km/hour, how long will it take for the train to cover a distance of 600 km?
def solve() -> int: speed = 500 / 5 new_speed = speed + 20 time = 600 / new_speed result = time return result
Student: 3. There are three times as many people in the History class as in the Chemistry class. If the Chemistry class has 36 people, how many people are in the History class?
def solve() -> int: chem_class = 36 hist_class = 3 * chem_class result = hist_class return result
At a math contest, there are 12 problems. Each problem is worth 5 points. If Ann answers 8 problems correctly, what is her percentage score?
def solve() -> int: total_problems = 12 point_per_problem = 5 correct_problems = 8 total_points = total_problems * point_per_problem score = correct_problems / total_problems * 100 result = score return result
A car traveled 150 miles in 3 hours. How many miles per hour was the car traveling?
def solve() -> int: total_distance = 150 total_time = 3 miles_per_hour = total_distance / total_time result = miles_per_hour return result
Last month, Alex paid $21,000 for 150 jackets from Kate’s Clothing Store. The next day, Kate realized that she had overcharged Alex for the jackets. If each jacket costs $140, how much money should Kate reimburse Alex as a refund?
def solve() -> int: jacket_price = 140 total_jackets = 150 total_cost = jacket_price * total_jackets refund_amount = total_cost - 21000 result = refund_amount return result
If the cake bakery sells an average of 25 cakes per day, and they want to make a total sale of 500 cakes this month, how many more cakes do they need to sell if they have already sold 360 cakes?
def solve() -> int: avg_cakes_per_day = 25 total_cakes_this_month = 500 cakes_sold_so_far = 360 cakes_left_to_sell = total_cakes_this_month - cakes_sold_so_far cakes_left_to_sell_per_day = cakes_left_to_sell / (30 - 1) result = cakes_left_to_sell_per_day return result
A farmer harvested a basket of apples. He divided 2/5 of the apples equally among his 2 cows and the remaining among his 5 goats. One cow got 18 apples. How many apples did the other cow get, if the farmer harvested 50 apples in total?
def solve() -> int: apples_harvested = 50 total_cows = 2 total_goats = 5 apples_cows = (2/5) * apples_harvested apples_goats = apples_harvested - apples_cows apples_per_cow = apples_cows / total_cows apples_per_goat = apples_goats / total_goats other_cow_apples = apples_pe...
A bucket contains 5 liters of water. If 1/4 of the water is used to water the plants, how many liters of water are left in the bucket?
def solve() -> int: water_in_bucket = 5 used_for_plants = water_in_bucket * (1/4) remaining_water = water_in_bucket - used_for_plants result = remaining_water return result
Student: Emily goes grocery shopping for her family. The total bill comes up to $150. If the sales tax rate is 8%, what will be her total cost after tax?
def solve() -> int: bill = 150 tax_rate = 0.08 tax = bill * tax_rate total_cost = bill + tax result = total_cost return result
If the combined weight of three boxes of books is 160 pounds, and the second box is 10 pounds heavier than the first and the third box is 5 pounds lighter than the second, what is the average weight of the boxes?
def solve() -> int: first_box_weight = 0 second_box_weight = 0 third_box_weight = 0 first_box_weight = 160 / 3 second_box_weight = first_box_weight + 10 third_box_weight = second_box_weight - 5 average_weight = (first_box_weight + second_box_weight + third_box_weight) / 3...
The sum of five consecutive integers is 325. What is the third integer?
def solve() -> int: n1 = 0 n2 = n1 + 1 n3 = n2 + 1 n4 = n3 + 1 n5 = n4 +1 result = n3 return result
A glass of lemonade requires 2 lemons. A pack of 25 lemons costs $5. How much must Lisa spend to make 15 glasses of lemonade?
def solve() -> int: lemons_per_glass = 2 cost_per_pack = 5 lemons_per_pack = 25 glasses_needed = 15 cost_per_lemon = cost_per_pack / lemons_per_pack lemons_needed = glasses_needed * lemons_per_glass packs_needed = lemons_needed / lemons_per_pack total_cost = packs_needed * cost...
Michelle wants to have a movie night with her friends. If she wants to buy a 6-pack of soda and a large pizza for $15, how much can she spend on each soda if the total budget is $25?
def solve() -> int: soda_pack = 6 pizza_cost = 15 total_budget = 25 soda_budget = total_budget - pizza_cost each_soda_budget = soda_budget / soda_pack result = each_soda_budget return result
Amy's water hose can fill a pool with 2 gallons of water every minute. If the pool is 16 gallons, how many minutes will it take for the hose to fill it up?
def solve() -> int: pool_size = 16 gallons_per_minute = 2 result = pool_size / gallons_per_minute return result
Lily collects 10 stamps every week from Monday to Friday. On Saturday, she collects 15 stamps. On Sunday, she collects 5 stamps. Every 4 weeks, she exchanges 50 stamps for a new album. How many albums does Lily get in 12 weeks?
def solve() -> int: monday = 10 tuesday = 10 wednesday = 10 thursday = 10 friday = 10 saturday = 15 sunday = 5 weekly = monday + tuesday + wednesday + thursday + friday + saturday + sunday total = weekly * 12 album = 50 result = total // album return...
A basketball team played 25 games and won 60% of them. How many games did the team win?
def solve() -> int: num_games = 25 win_percentage = 0.6 num_wins = num_games * win_percentage result = num_wins return result
In a bake sale, there are 80 cupcakes to be sold. Emma sold half as many cupcakes as Lila, while Hannah sold two more than a quarter the number of cupcakes Lila sold. If Lila had sold 32 cupcakes, how many cupcakes need to be sold in total?
def solve() -> int: lila_cupcakes = 32 emma_cupcakes = lila_cupcakes / 2 hannah_cupcakes = (lila_cupcakes * 0.25) + 2 total_cupcakes = lila_cupcakes + emma_cupcakes + hannah_cupcakes + 80 result = total_cupcakes return result
Lisa bought a bicycle for $300.00 at a sports store that was offering a 30% off coupon for any item over $200.00. She also had to pay a $20.00 assembly fee and a 6% sales tax. How much did Lisa pay for the bicycle after the coupon, fee, and tax?
def solve() -> int: coupon_price = 300 * (1 - 0.3) fee_price = coupon_price + 20 tax = fee_price * 0.06 final_price = fee_price + tax result = final_price return result
Result: There are 36 pencils in the box. There are 45 cars and buses in a parking lot. The number of buses is three times the number of cars. How many cars are in the parking lot?
def solve() -> int: x = 3 y = x + 1 z = 45 / y result = z * x return result