question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A rectangle has a length of 6cm and a width of 4cm. What is the area of the rectangle?
def solve() -> int: length = 6 width = 4 area = length * width result = area return result
A food store sold 90 bags of chips on the first day and 120 bags on the second day. If the store sold 50% more bags on each subsequent day, how many bags of chips were sold on the 4th day?
def solve() -> int: bags_first_day = 90 bags_second_day = 120 bags_third_day = bags_second_day * 1.5 bags_fourth_day = bags_third_day * 1.5 total_bags_sold = bags_first_day + bags_second_day + bags_third_day + bags_fourth_day bags_on_fourth_day = total_bags_sold - (bags_first_day + bags_second_d...
Student: The sum of Larry's age and Bert's age was 40 5 years ago. In 12 years Bert will be 33. How old is Larry now?
def solve() -> int: larry_age_5_years_ago = 40 - 33 bert_age_5_years_ago = 40 - larry_age_5_years_ago larry_age_now = larry_age_5_years_ago + 12 result = larry_age_now return result
3. How many candy bars will Brian need to buy for his class if he needs to buy one for each students and there are 22 students in the class and each candy bar contains 10 pieces?
def solve() -> int: students = 22 pieces = 10 candy_bars = students * pieces result = candy_bars return result
Joyce has 15 books in total. She bought 5 of them and swapped the rest with her friends. How many books does Joyce own after the swap?
def solve() -> int: total_number_of_books = 15 number_of_books_bought = 5 number_of_books_swapped_with_friends = total_number_of_books - number_of_books_bought number_of_books_kept_by_Joyce = number_of_books_bought + number_of_books_swapped_with_friends result = number_of_books_kept_by_Jo...
Nolan, Riley, and Perry collect coins. Nolan had 40 coins before he gave Perry 5 coins. Riley had 32 coins before giving Perry 7 coins. After all the gifts, Perry now has 4 more coins than Nolan, how many less coins does Riley have now than Perry?
def solve() -> int: perry_gifts = 5 + 7 nolan_left = 40 - 5 riley_left = 32 - 7 perry_total = nolan_left + perry_gifts + 4 difference = perry_total - riley_left result = difference return result
Possible questions and programs: Nina can read 16 pages of a book in 20 minutes. At this same rate, how many pages could she read in 1.5 hours?
def solve() -> int: rate = 16 / 20 minutes = 1.5 * 60 pages = rate * minutes result = pages return result
Student: Steffan is setting up a row of chairs in a line with 71 chairs. If each chair is separated by a one foot gap, how many feet long will the line of chairs be?
def solve() -> int: chairs = 71 gap = 1 gaps_length = gap * (chairs - 1) chair_width = 1.5 chairs_length = chairs * chair_width line_length = gaps_length + chairs_length result = line_length return result
Colin has 72 pieces of gum. He puts them into 8 containers, each container with the same number of pieces of gum. How many pieces of gum does Colin have in each container?
def solve() -> int: total_count = 72 num_containers = 8 gum_per_container = total_count // num_containers result = gum_per_container return result
Naomi is baking a cake for her friend's birthday. She needs to buy flour, sugar, eggs, butter, and frosting. The flour costs $2.99 per bag, the sugar costs $1.29 per pound, the eggs cost $2.49 per dozen, the butter costs $3.99 per pound, and the frosting costs $2.49 per can. She needs one bag of flour, two pounds of su...
def solve() -> int: flour = 2.99 * 1 sugar = 1.29 * 2 eggs = 2.49 / 12 * 6 butter = 3.99 * 0.5 frosting = 2.49 * 1 total = flour + sugar + eggs + butter + frosting total = round(total, 2) result = total return result
Dave's factory produces 4 times as many water bottles as Julie's. Cindy's factory produces 1/5 the amount of total water bottles between Dave and Julie's factories. If 20 water bottles are thrown away from Cindy's factory, how many water bottles are there in total between the 3 factories?
def solve() -> int: julie_bottles = 1 dave_bottles = 4 * julie_bottles total_bottles = julie_bottles + dave_bottles cindy_bottles = total_bottles / 5 cindy_bottles -= 20 total_bottles += cindy_bottles result = total_bottles return result
Possible questions and programs: Anna had $60 in her wallet. She spent $12.50 on a book, $3.25 on a coffee and $18 on a shirt. If she only has dimes left of her original money, how many dimes does she now have?
def solve() -> int: total_spent = 12.50 + 3.25 + 18 money_left = 60 - total_spent dimes = money_left * 10 dimes = int(dimes) result = dimes return result
Grace is taking an 800-mile trip and drives at a speed of 70 miles per hour. How much faster must she travel to decrease her travel time by 7 hours?
def solve() -> int: distance = 800 speed = 70 time = distance / speed new_time = time - 7 new_speed = distance / new_time increase_in_speed = new_speed - speed result = increase_in_speed return result
A group of 6 friends went to a restaurant and received a total bill of $156, which includes a 15% tip. Each person wants to split the bill equally. How much does each person pay, including the tip?
def solve() -> int: total_cost = 156 tip = total_cost * 0.15 total_with_tip = total_cost + tip each_person_pays = total_with_tip / 6 result = round(each_person_pays, 2) return result
Peter has $400 in his savings account. He deposits $100 every month. How much money would he have in his account after 2 years?
def solve() -> int: balance = 400 monthly_deposit = 100 num_months = 24 total_deposits = monthly_deposit * num_months final_balance = balance + total_deposits result = final_balance return result
Dora was 10 years older than her cousin 3 years ago. Her cousin is now 16 years old. How old will Dora be 5 years from now?
def solve() -> int: cousin_age_3y = 16 - 3 dora_age_3y = cousin_age_3y + 10 current_age = dora_age_3y + 3 future_age = current_age + 5 result = future_age return result
In a class of 30 students, the teacher wants to divide them equally into 5 groups. How many students should each group have?
def solve() -> int: num_students = 30 num_groups = 5 result = num_students // num_groups return result
Ava and Olivia were practicing their guitar skills. If they played a total of 72 chords, how many chords did each of them play?
def solve() -> int: total_chords = 72 ava_chords = total_chords // 2 olivia_chords = total_chords - ava_chords result = f'<<<Ava played {ava_chords} chords and Olivia played {olivia_chords} chords.>>>' return result
After finishing Wednesday's work, James and his siblings have 45 minutes of free time. If each bedroom takes 15 minutes to clean, how many bedrooms can they manage to clean in the time remaining?
def solve() -> int: time_each_bedroom = 15 bedrooms_in_time = 45 / time_each_bedroom result = bedrooms_in_time return result
Student: A batch of cookies requires 2 eggs, 1 cup of sugar and 2 cups of flour. If you want to make 24 cookies, how many cups of flour will you need?
def solve() -> int: num_cookies = 24 num_eggs = 2 num_sugar = 1 num_flour = 2 num_flour_needed = num_cookies * num_flour / num_eggs result = num_flour_needed return result
Noah has 8 oranges, he gives away 3 to his friends. Later he eats a quarter of the fruits he has left. How many fruits are left?
def solve() -> int: oranges = 8 given_away = 3 remaining = oranges - given_away left = remaining - (remaining*0.25) result = left return result
Student: Ethan wants to calculate the average distance he walks on his daily commute. He has been tracking his walking distance for the past week. The distances were 1.2 miles, 0.9 miles, 1.1 miles, 1.3 miles, 1.2 miles, 1.1 miles, and 1.4 miles. What was his average walking distance in miles?
def solve() -> int: distance1 = 1.2 distance2 = 0.9 distance3 = 1.1 distance4 = 1.3 distance5 = 1.2 distance6 = 1.1 distance7 = 1.4 total_distance = distance1 + distance2 + distance3 + distance4 + distance5 + distance6 + distance7 average_distance = total_distance / 7 result = av...
Mario got a 25% discount on a $120 shirt. How much did he have to pay for the shirt, in dollars?
def solve() -> int: discounted_price = 120 - (0.25 * 120) result = discounted_price return result
Student: If the radius of a circle is 8 cm, what is the circumference of the circle rounded to the nearest cm?
def solve() -> int: radius = 8 circumference = 2 * 3.14 * radius result = round(circumference) return result
Student: Bill and Susie take part in a charity bike ride to raise money for a local food bank. Bill manages to raise $375 and Susie raises $265. Bill decides to donate 10% of his money and Susie decides to donate 15%. How much money in total did Bill and Susie donate to the food bank?
def solve() -> int: bill_raised = 375 susie_raised = 265 bill_donation = bill_raised * 0.1 susie_donation = susie_raised * 0.15 total_donation = bill_donation + susie_donation result = total_donation return result
A jewelry store sold 40 rings. Three customers bought six rings each, five customers bought four rings each, and the rest bought two rings each. How many customers bought two rings?
def solve() -> int: rings = 40 six_rings = 3 four_rings = 5 rings_bought = six_rings * 6 + four_rings * 4 rings_left = rings - rings_bought two_rings = rings_left // 2 result = two_rings return result
-A bakery sells muffins at $2 each, cakes at $12 each, and pies at $8 each. There is a 10% discount on muffins, and a 15% discount on pies. The sales tax is 6%. John wants to buy twelve muffins, four cakes, and six pies for his family. How much does John have to pay for all the items, including the sales tax?
def solve() -> int: muffin_cost = 2 * 12 * 0.9 cake_cost = 12 * 4 pie_cost = 8 * 6 * 0.85 subtotal = muffin_cost + cake_cost + pie_cost tax = subtotal * 0.06 total = subtotal + tax result = total return result
Student: A rectangular box is 15 cm long, 10 cm wide, and 5 cm high. What is its volume?
def solve() -> int: length = 15 width = 10 height = 5 volume = length * width * height result = volume return result
Student: Lily has a total of 110 apples and bananas combined. If the ratio of the number of apples to bananas is 3:5 and she sells 40% of the bananas, how many fruits are left?
def solve() -> int: total_fruits = 110 ratio_apples = 3 ratio_bananas = 5 percent_sold = 0.4 num_apples = total_fruits * ratio_apples / (ratio_apples + ratio_bananas) num_bananas = total_fruits * ratio_bananas / (ratio_apples + ratio_bananas) num_bananas_sold = num_bananas * percent_sold ...
A landscaper wants to decorate a rectangular garden with dimensions 9 meters by 7 meters with a path that is 1.5 meters wide around it. What is the area of the pathway?
def solve() -> int: length = 9 width = 7 path_width = 1.5 area_of_pathway = 2*(length + width)*path_width result = area_of_pathway return result
A restaurant uses ovens to bake pizzas. Each pizza takes an oven 3 minutes to prepare the ingredients and 12 minutes to bake the pizza. If the restaurant has 4 ovens working on pizzas at the same time, how many pizzas can the ovens bake in 1.5 hours?
def solve() -> int: oven_prep_time = 3 oven_bake_time = 12 num_ovens = 4 time_in_hours = 1.5 total_time_in_minutes = time_in_hours * 60 total_pizza_time = oven_prep_time + oven_bake_time pizzas_baked_per_oven = total_time_in_minutes // total_pizza_time total_pizzas_baked = pizzas_ba...
Sarah is making a cake and needs 3 eggs for the batter, but only has a carton with 12 eggs in it. If she makes the cake twice, how many eggs will she have left?
def solve() -> int: eggs_per_cake = 3 eggs_in_carton = 12 eggs_used = eggs_per_cake * 2 eggs_left = eggs_in_carton - eggs_used result = eggs_left return result
A litter of puppies were born in a kennel. Every week, the number of puppies would triple. After two weeks, there were 27 puppies in the kennel. How many puppies were born in the litter?
def solve() -> int: weeks = 2 total_puppies = 27 puppies_first_week = total_puppies / 3 puppies_second_week = puppies_first_week / 3 puppies_born = puppies_first_week + puppies_second_week result = puppies_born return result
Michael pays for a $9.99 sandwich with a $20 bill. If the cashier gives him the smallest number of coins possible as change, how many coins will Michael get as change?
def solve() -> int: cost_of_sandwich = 9.99 amount_paid = 20 change = amount_paid - cost_of_sandwich quarters = change // 0.25 dimes = (change - (quarters * 0.25)) // 0.1 nickels = (change - (quarters * 0.25) - (dimes * 0.1)) // 0.05 pennies = (change - (quarters * 0.25) - (dimes * 0.1) -...
The ratio of cat to dogs in a shelter is 4:5. The total number of cats and dogs in the shelter is 54. How many dogs are in the shelter?
def solve() -> int: total = 54 cat_ratio = 4 dog_ratio = 5 dog_total = (dog_ratio / (cat_ratio + dog_ratio)) * total result = dog_total return result
A restaurant buys 20 pounds of meat every day. If they are closed for 2 days every week, how many pounds of meat do they buy in 3 weeks?
def solve() -> int: pounds_per_day = 20 days_per_week = 5 weeks = 3 total_pounds = pounds_per_day * (7 - days_per_week) * weeks result = total_pounds return result
A box contains 24 pieces of candy. If 6 of those pieces are strawberry flavored, how many pieces of candy are chocolate flavored?
def solve() -> int: number_of_candy = 24 number_of_strawberry_flavored_candy = 6 number_of_chocolate_flavored_candy = number_of_candy - number_of_strawberry_flavored_candy result = number_of_chocolate_flavored_candy return result
A box contains 30 red balls, 20 blue balls and 10 green balls. If a ball is selected at random, what is the probability of it being a red ball?
def solve() -> int: totalballs = 60 redballs = 30 prob_redball = redballs/totalballs result = prob_redball return result
Student: Ethan drove his car at a speed of 50 miles per hour for 2 hours. How far did he travel in that time?
def solve() -> int: speed = 50 time = 2 distance = speed * time result = distance return result
Ben arrived in Canada and his suitcase weighed 14 pounds. While in Canada, he bought 4 sweatshirts weighing 1.3 pounds each, 2 snow globes weighing 1.2 pounds each, and 1 maple syrup bottle weighing 2.2 pounds. How much did Ben's suitcase weigh on the return flight home?
def solve() -> int: suitcase_weight = 14 sweatshirt_weight = 4 * 1.3 snow_globe_weight = 2 * 1.2 maple_syrup_weight = 2.2 total_weight = sweatshirt_weight + snow_globe_weight + maple_syrup_weight return_weight = suitcase_weight + total_weight result = return_wei...
A company produces 500 pens a day. They made 3500 pens in a week, but dropped and broke 100 pens. What is the total number of pens they have left?
def solve() -> int: pens_per_day = 500 days_per_week = 7 total_pens = pens_per_day * days_per_week broken_pens = 100 total_pens_remaining = total_pens + (3500 - total_pens) - broken_pens result = f'<<<{total_pens_remaining}>>>' result = total_pens_remaining return result
A bike and a car together cost $7000. The car costs $2000 more than the bike. How much does the bike cost?
def solve() -> int: bike_cost = (7000 - 2000) / 2 result = bike_cost return result
The student body of school A is 4 times larger than that of school B. School B has 210 students. If 900 students leave school A, and 40% of the remaining population is girls, how many girls remain in school A?
def solve() -> int: school_b = 210 school_a = 4 * school_b school_a -= 900 remaining_population = school_a girls = remaining_population * 0.4 result = girls return result
Student: There are 180 books in a library. Together they weigh 130 kg. What is the average weight of each book?
def solve() -> int: num_books = 180 total_weight = 130 average_weight = total_weight / num_books result = average_weight return result
Answer 1: 54 candies are shared with his friends. Alice painted 8 pictures, with 9 different colors in each picture. She used 1/3 of each color for each picture, and then mixed the remaining colors together to make a new color. How many different colors did she have in total after mixing the colors?
def solve() -> int: pictures = 8 colors_per_picture = 9 total_colors = pictures * colors_per_picture colors_used = total_colors * 1/3 colors_left = total_colors - colors_used colors_mixed = pictures result = colors_used + colors_mixed return result
A recipe calls for 2 cups of flour, 1/2 cup of sugar, 1/4 cup of milk and 1/4 teaspoon of salt. If you want to double the recipe, how many cups of flour will you need?
def solve() -> int: original_flour = 2 double_factor = 2 doubled_flour = original_flour * double_factor result = doubled_flour return result
A gym has 14 treadmills, each holding 200 pounds. If an average person weighs 160 pounds, how many people can be on the treadmills at one time?
def solve() -> int: num_treadmills = 14 treadmill_capacity = 200 weight_person = 160 num_people = num_treadmills * (treadmill_capacity // weight_person) result = num_people return result
Student: Ned can plant 5 pots of flowers in 10 minutes. How many pots of flowers can he plant in 25 minutes?
def solve() -> int: pots_per_10_min = 5 time = 25 result = pots_per_10_min * (time / 10) return result
Student: Vikram drove 9600 miles in two months. On average, how many miles did he drive each day?
def solve() -> int: miles_driven = 9600 months = 2 days = months * 30 average_miles_per_day = miles_driven / days result = average_miles_per_day return result
David and his friends went skiing. They skied on one slope that lasted for 3 hours and another slope that was half as long. Before skiing, they spent 15 minutes putting on their gear and twice as long packing their lunches. How long, in hours, did they spend on their skiing adventure?
def solve() -> int: slope1_duration = 3 slope2_duration = slope1_duration / 2 gear_time = 15 / 60 lunch_time = 2 * gear_time total_skiing_time = slope1_duration + slope2_duration total_time = total_skiing_time + gear_time + lunch_time result = total_time return result
Student: Sarah can run 5 miles in 45 minutes. If John can run 3 times faster than Sarah, how long would it take for John to run 10 miles?
def solve() -> int: distance_sarah = 5 time_sarah = 45 speed_john = 3 * (distance_sarah / time_sarah) distance_john = 10 time_john = distance_john / speed_john result = time_john return result
A catering service makes a profit of $2,800 selling sandwiches and salads. If they sold three times as many sandwiches as salads and each salad cost $10, how many sandwiches did they sell?
def solve() -> int: salad_cost = 10 profit = 2800 salads_sold = profit / salad_cost sandwiches_sold = 3 * salads_sold result = sandwiches_sold return result
For his monthly assignment, Mike has 30 math problems, 15 social studies problems, and 20 science problems. If he takes 2 minutes to solve each math problem, 30 seconds to solve each social studies problem, and 2.5 minutes to solve each science problem, how long will it take Mike to finish his monthly assignment?
def solve() -> int: math_problems = 30 social_studies_problems = 15 science_problems = 20 time_per_math_problem = 2 time_per_social_studies_problem = 0.5 time_per_science_problem = 2.5 total_time = (math_problems * time_per_math_problem) + (social_studies_problems * time_per_social...
Student: Ahmed has several empty buckets of different sizes, holding either 2, 6, or 9 liters. He fills the 6-liter bucket and pours as much as he can into the 2-liter bucket. Then, he pours the remainder into the 9-liter bucket. How much more water, in liters, can he put into the 9-liter bucket, without overflowing?
def solve() -> int: bucket_2 = 2 bucket_6 = 6 bucket_9 = 9 filled_6 = bucket_6 filled_2 = min(bucket_2, filled_6) remainder_6 = filled_6 - filled_2 filled_9 = remainder_6 remainder_9 = bucket_9 - filled_9 more_water = remainder_9 result = more_water return result
To attend a conference, Elena drove 100 miles to the venue and back. She used her car, which requires 10 gallons of fuel to cover 200 miles. How many gallons of fuel did Elena consume for the trip?
def solve() -> int: distance = 100 total_distance = 200 fuel_required = 10 fuel_consumed = (distance / total_distance) * fuel_required result = fuel_consumed return result
Nina has $60 to buy some clothes at the mall. She bought 2 shirts and 3 pants. Each shirt cost $13 and each pant cost $11. How much money does Nina have left?
def solve() -> int: money = 60 money = money - 2 * 13 money = money - 3 * 11 result = money return result
Student: Vinny is going to transport a pallet of boxes that weigh 25 kilograms each. If he has to transport thirty of them, then how many total kilograms will the pallet weigh?
def solve() -> int: box_weight = 25 box_number = 30 pallet_weight = box_weight * box_number result = pallet_weight return result
``` A box of cereal contains 12 servings. Each serving is 35 grams. How many grams of cereal are in the entire box?
def solve() -> int: num_servings = 12 serving_size = 35 total_cereal = num_servings * serving_size result = total_cereal return result
A beach resort charges $100 dollars for a beach cabana. Rachel rents the cabana for the day and orders 3 poolside drinks which cost $12 each. She also buys herself a beach towel which costs $25 and leaves a 20% tip on everything she orders. How much does she spend for the day at the beach resort? If it takes Sarah 4 mo...
def solve() -> int: cabana_cost = 100 drink_cost = 12 num_drinks = 3 towel_cost = 25 tip_percent = 20/100 subtotal = cabana_cost + (drink_cost * num_drinks) + towel_cost tip_amount = subtotal * tip_percent total_cost = subtotal + tip_amount x = 3 y = x + 4 total_tim...
There are 68 students in a classroom. Each student needs to use 4 markers for an art project. How many markers are necessary to finish the project?
def solve() -> int: total_markers = 68 * 4 result = total_markers return result
Emily has 8 stamps. Her friend, Jack, has 2 stamps. Jack's grandmother gave him 4 more stamps than Emily and Jack combined. How many stamps do they have in total?
def solve() -> int: emily_stamps = 8 jack_stamps = 2 jack_grandmother_stamps = (emily_stamps + jack_stamps) + 4 total_stamps = emily_stamps + jack_stamps + jack_grandmother_stamps result = total_stamps return result
If a jar can hold 2 liters of water and already has 0.5 liters in it, what percent of the jar is filled with water?
def solve() -> int: max_volume = 2 current_volume = 0.5 percent_filled = (current_volume / max_volume) * 100 result = percent_filled return result
Annie is making cookies for her friends. She wants 1/3 of the cookies to have peanuts, 1/5 to have raisins, and the rest to have both peanuts and raisins. If she adds 7 peanuts per cookie and 1 tablespoon of raisins per cookie, and she makes 60 cookies, how many peanuts and tablespoons of raisins does she need?
def solve() -> int: cookies = 60 peanuts_per_cookie = 7 raisins_per_cookie = 1 peanuts_cookies = cookies * (1/3) raisins_cookies = cookies * (1/5) both_cookies = cookies - peanuts_cookies - raisins_cookies peanuts_needed = peanuts_cookies * peanuts_per_cookie raisins_needed = (...
On a lunar mission, the space shuttle must be landed on the moon's surface. If the shuttle has a speed of 10 km/s and the mission time is 60s, how many kilometers will the shuttle have traveled?
def solve() -> int: velocity = 10 time = 60 distance = velocity * time result = distance return result
Student: John and Karen are fixing up an old car. John works an average of 9 hours per day for 5 days and Karen works an average of 6 hours per day for 4 days. What is the total number of hours they both worked on the car?
def solve() -> int: john_hours = 9 john_days = 5 karen_hours = 6 karen_days = 4 john_total = john_hours * john_days karen_total = karen_hours * karen_days total_hours = john_total + karen_total result = total_hours return result
Sam and Tara are making lemonade for a fundraiser. They need 4 cups of sugar for every 6 cups of lemon juice. They have 36 cups of lemon juice and 20 cups of sugar. How many cups of lemonade can they make with the ingredients they have?
def solve() -> int: ratio = 4 / 6 min_ingredient = min(20, 36 * ratio) lemon_juice = min_ingredient / ratio lemonade = lemon_juice / 6 result = lemonade return result
Olivia bought a new dress for $70, which is one-fourth of her new total clothing expenses for the month. How much did Olivia spend on clothing before buying the new dress?
def solve() -> int: dress_cost = 70 total_clothing_expenses = dress_cost * 4 previous_clothing_expenses = total_clothing_expenses - dress_cost result = previous_clothing_expenses return result
A bookstore purchased 300 books for $1500. If they sold each book for $8, what was their profit?
def solve() -> int: book_count = 300 cost = 1500 price = 8 total_income = price * book_count profit = total_income - cost result = profit return result
Student: A van can carry a maximum of 800 kgs of goods. It already has 12 baskets that weigh 25 kgs each and 6 boxes that weigh 15 kgs each. How many cartons that weigh 10 kgs each can be added to the van without exceeding the limit?
def solve() -> int: baskets = 12 basket_weight = 25 boxes = 6 box_weight = 15 carton_weight = 10 max_weight = 800 total_weight = baskets * basket_weight + boxes * box_weight remaining_weight = max_weight - total_weight cartons = remaining_weight // carton_weight result = cartons ...
Anna invested $3000 in Chainlink. In the first week, it gained 20% in value. In the second week, it lost 35% on top of the previous gain. How much is her investment worth now?
def solve() -> int: investment = 3000 gain1 = investment * 0.2 investment = investment + gain1 loss2 = investment * 0.35 investment = investment - loss2 result = investment return result
Tom uses his credit card for all his purchases, including gas which costs him $40 per week. His credit card company charges a 20% interest rate on unpaid balances. At the end of the month, Tom pays only the minimum monthly payment of $50. What is the balance on his credit card after 6 months of this cycle?
def solve() -> int: gas_cost_per_month = 40 * 4 total_cost_per_month = gas_cost_per_month + 50 for i in range(6): balance_after_interest = total_cost_per_month * 1.2 new_balance = balance_after_interest - 50 total_cost_per_month = new_balance result = new_balance return resu...
James has 8 items that cost $3.20 each and 7 items that cost $2.50 each. How much does he need to pay in total?
def solve() -> int: items_1 = 8 price_1 = 3.20 items_2 = 7 price_2 = 2.50 total_price = (items_1 * price_1) + (items_2 * price_2) result = total_price return result
Student: There are 6 jars of cookies in a bakery. Each jar has 24 cookies, except for the last jar that has 15 cookies. The baker sells each cookie for 25 cents. If he sells half of the cookies in each jar, how much money does he make?
def solve() -> int: jars = 6 cookies_per_jar = 24 last_jar = 15 price = 0.25 total_cookies = (jars - 1) * cookies_per_jar + last_jar cookies_sold = total_cookies / 2 money = cookies_sold * price result = money return result
Student: Michael ate 3/4 of a pizza on Monday, and 1/3 of a pizza on Tuesday. How much of the pizza did he eat in total?
def solve() -> int: pizza = 1 monday = 3/4 tuesday = 1/3 total = monday + tuesday result = total * pizza return result
Arthur has 12 chocolates. He wants to evenly split the 12 chocolates among 4 people. How many chocolates does each person get?
def solve() -> int: num_chocolates = 12 num_people = 4 chocolates_per_person = num_chocolates / num_people result = chocolates_per_person return result
A store sells apples at 60 cents each and the price of each apple is reduced by 20%. What would be the new price of 10 apples?
def solve() -> int: original_price = 0.6 * 10 new_price = original_price * (1 - 0.2) result = new_price return result
Andy is buying a bunch of flowers for his girlfriend. There are 40 roses, 30 daisies, and 20 lilies in the bouquet. If each rose has 12 petals, each daisy has 4 petals, and each lily has 10 petals, how many petals are there in total?
def solve() -> int: roses = 40 daisies = 30 lilies = 20 rose_petals = 12 daisy_petals = 4 lily_petals = 10 total_petals = (roses * rose_petals) + (daisies * daisy_petals) + (lilies * lily_petals) result = total_petals return result
Mason and Lily start completing a jigsaw puzzle at the same time. Mason uses a puzzle with 100 pieces, and it takes him 1 hour to complete. Lily uses a puzzle with 150 pieces, and it takes her 2 hours to complete. If they start with 3 puzzles each, how many hours later will Lily finish the third puzzle after Mason?
def solve() -> int: mason_pieces = 100 mason_time = 1 lily_pieces = 150 lily_time = 2 start_puzzles = 3 mason_time_per_puzzle = mason_time / mason_pieces lily_time_per_puzzle = lily_time / lily_pieces mason_time_for_three_puzzles = mason_time_per_puzzle * (start_puzzles * mason...
A car rental company charges $50 per day for a car and $0.25 per km driven. Frank rented a car for 4 days and drove it 350 km. How much did he have to pay in total?
def solve() -> int: rental_cost = 50 * 4 + 0.25 * 350 result = rental_cost return result
Student: The volume of a cube is 1000cm^3. Calculate the length of each side of the cube.
def solve() -> int: volume = 1000 side = volume**(1/3) result = side return result
Rainbow City has 150 balloons. This means there are 30 more than 4 times as many balloons in Sunshine City. How many balloons are there in Sunshine City?
def solve() -> int: balloons_in_rainbow_city = 150 balloons_in_sunshine_city = (balloons_in_rainbow_city - 30) / 4 result = balloons_in_sunshine_city return result
John wants to buy 4 shirts that each cost $15 and a pair of pants that cost $20. How much will he spend in total?
def solve() -> int: shirts_cost = 15 * 4 pants_cost = 20 total_cost = shirts_cost + pants_cost result = total_cost return result
The cost of a bundle of 25 napkins is $3. If the cost of each napkin is 8 cents, how much can you save, in cents, per napkin if you buy the bundle versus individual napkins?
def solve() -> int: bundle_size = 25 bundle_cost = 3 napkin_cost = 0.08 cost_per_napkin = bundle_cost / bundle_size savings_per_napkin = napkin_cost - cost_per_napkin savings_in_cents = savings_per_napkin * 100 result = savings_in_cents return result
Jack covers a distance of 8 km in 1 hour and 20 minutes. Calculate his speed in m/s.
def solve() -> int: distance = 8 time = 1.33 speed_in_km_per_h = distance / time speed_in_m_per_s = speed_in_km_per_h * (1000/3600) result = speed_in_m_per_s return result
Student: If the cost of one pen is 25 cents, how many pens can you buy for $5?
def solve() -> int: cost_of_one_pen = 0.25 total_cost = 5 number_of_pens = total_cost / cost_of_one_pen result = number_of_pens return result
Michael sells his old guitar for 50% of its original value and then buys a new guitar with a 20% discount. If his old guitar was worth $800 and the new guitar had a sticker price of $1000, how much was he out of pocket?
def solve() -> int: old_guitar_value = 800 new_guitar_price = 1000 amount_received = old_guitar_value * 0.5 amount_paid = new_guitar_price * 0.8 out_of_pocket = amount_paid - amount_received result = out_of_pocket return result
Lily and Jake are wrapping presents for a holiday. Lily uses tape 5 times as often as Jake. If they wrap a total of 30 presents, how many presents did Jake use tape on?
def solve() -> int: total_presents = 30 lily_tape_ratio = 5 jake_tape_ratio = 1 / lily_tape_ratio jake_presents = total_presents * jake_tape_ratio result = jake_presents return result
Rachel works at a restaurant and earns $12 per hour. She worked 35 hours last week and gets 1.5 times her hourly pay for overtime. How much did she earn for the week?
def solve() -> int: hours_worked = 35 hourly_rate = 12 overtime_rate = 1.5 regular_pay = hourly_rate * hours_worked overtime_hours = max(hours_worked - 40, 0) overtime_pay = overtime_hours * hourly_rate * overtime_rate total_pay = regular_pay + overtime_pay result = total_pay return ...
John bought a watch for $1500, and some straps for 8% of the price of the watch. If he had twice the price of the watch before the purchase, what was the initial amount of money John had?
def solve() -> int: watch_price = 1500 straps_price = 0.08 * watch_price total_price = watch_price + straps_price initial_amount = total_price / 2 result = initial_amount return result
Student: At a party, 312 people turned up. Each person was served either a type of chicken dish or a type of fish dish. There were 6 fewer chicken dishes than fish dishes and 3 less people had chicken than fish. How many chicken dishes were served?
def solve() -> int: total_people = 312 chicken_people = None fish_people = None chicken_dishes = None fish_dishes = None fish_people = (total_people + 3) / 2 chicken_people = total_people - fish_people fish_dishes = fish_people chicken_dishes = fish_dishes - 6 result = c...
A basketball team scored an average of 92 points over 10 games. In the next game, they scored 108 points. What is their new average score?
def solve() -> int: total_points = 92*10 + 108 games_played = 11 new_average = total_points / games_played result = new_average return result
Rachel has 10 candies. She ate two and gave away three. What fraction of the original candies does she have left?
def solve() -> int: candies = 10 ate = 2 gave_away = 3 remaining_candies = candies - ate - gave_away fraction_left = remaining_candies / candies result = fraction_left return result
Rachel spent 25 dollars on coffee last week. If she plans to spend 4 dollars a day this week, how much less money will she spend this week?
def solve() -> int: coffee_last_week = 25 daily_spending_this_week = 4 * 7 difference = coffee_last_week - daily_spending_this_week result = difference return result
A supermarket sold 150 bottles of water on Monday, 180 bottles of water on Tuesday, and 210 bottles of water on Wednesday. How many bottles of water did they sell in total over the three days?
def solve() -> int: total_bottles_of_water = 150 + 180 + 210 result = total_bottles_of_water return result
A runner starts at point A, runs 5 km Northwards to point B, then takes a 3 km turn towards East to point C and finally takes a turn towards South and runs for 8 km to reach point D. If she runs back to point A following the same path, calculate the distance covered in total.
def solve() -> int: distance_AB = 5 distance_BC = 3 distance_CD = 8 distance_DA = distance_CD + distance_BC + distance_AB distance_back = 2*(distance_AB + distance_BC + distance_CD) total_distance = distance_DA + distance_back result = total_distance return result
At a zoo there are 150 animals. 50 of them are lions. The rest are either tigers or bears. If there are equal amounts of tigers and bears, how many animals are bears?
def solve() -> int: total_animals = 150 lions = 50 tigers = (total_animals - lions) / 2 bears = tigers result = bears return result
A movie theater has 5 theaters with a seating capacity of 100 each. If there are 225 people total, how many theaters need to be used?
def solve() -> int: theater_capacity = 100 total_customers = 225 num_theaters = total_customers // theater_capacity + (total_customers % theater_capacity > 0) result = num_theaters return result
If a store has sold 200 pencils at $2 each, how much profit did the store make assuming the cost price of each pencil is $1?
def solve() -> int: pencil_sold = 200 selling_price = 2 cost_price = 1 total_revenue = pencil_sold * selling_price total_cost = pencil_sold * cost_price profit = total_revenue - total_cost result = profit return result
amantha bought 7 pairs of shoes, each costing $55. How much money did Samantha spend in total?
def solve() -> int: number_of_items = 7 cost_per_item = 55 total_cost = number_of_items * cost_per_item result = total_cost return result
Gina bought 4 packs of batteries, 5 boxes of paper clips, and 10 bottles of glue. She used 70% of the batteries, 50% of the paper clips, and 90% of the glue. How many of the items did Gina use in total?
def solve() -> int: battery_used = 4 * 0.7 paper_clip_used = 5 * 0.5 glue_used = 10 * 0.9 result = battery_used + paper_clip_used + glue_used return result