question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Possible answer: Lisa starts biking from Boston to Philadelphia, which is 100 miles. Lisa bikes 30 miles the first day. The next day she bikes 10 miles more than two-thirds as much as she biked the first day. She bikes 15 miles the third day. How many miles further does Lisa have to bike to be in Philadelphia?
def solve() -> int: total_distance = 100 remaining_distance = total_distance first_day = 30 second_day = 10 + 2/3 * first_day third_day = 15 remaining_distance -= first_day remaining_distance -= second_day remaining_distance -= third_day result = remaining_distance ...
At a gym, 90 people were working out. Two-thirds of these people were lifting weights, and half of them were using the gym's equipment. If one-tenth of the remaining people were cardio training, how many people were using the gym's equipment and lifting weights?
def solve() -> int: total_people = 90 lifting_weights = total_people * (2/3) using_equipment = total_people * (1/2) remaining_people = total_people - lifting_weights - using_equipment cardio_training = remaining_people * (1/10) using_both = lifting_weights - cardio_training result = using_bo...
A rectangle has a width of 5 centimeters and an area of 30 square centimeters. What is the length of the rectangle?
def solve() -> int: width = 5 area = 30 length = area / width result = length return result
If there were 150 people in attendance at a concert and each ticket cost $35, how much money was made from ticket sales?
def solve() -> int: num_people = 150 ticket_price = 35 total_sales = num_people * ticket_price result = total_sales return result
In 12 years, Aiden will be half as old as his father. If his father is currently 50 years old, how old is Aiden now?
def solve() -> int: father_age = 50 years_to_add = 12 father_age_in_12_years = father_age + years_to_add aiden_age_in_12_years = father_age_in_12_years / 2 aiden_age_now = aiden_age_in_12_years - years_to_add result = aiden_age_now return result
Student: Mike has 10 dimes and Kevin has 15 dimes. If Mike gives away four times as many dimes as Kevin has, how many dimes does Mike have left?
def solve() -> int: mike = 10 kevin = 15 mike_gives = 4 * kevin mike_left = mike - mike_gives result = mike_left return result
A restaurant decided to allocate 30% of its tables to outdoor dining. The remaining tables are divided into two equal groups, one of which is reserved every day. What percentage of tables are reserved every day?
def solve() -> int: total_tables = 100 outdoor_tables = total_tables * 0.3 remaining_tables = total_tables - outdoor_tables reserved_tables = remaining_tables / 2 percentage_reserved = (reserved_tables / total_tables) * 100 result = percentage_reserved return result
Maya works at a bakery baking cupcakes. She made 450 cupcakes this weekend. The chocolate cupcake batch had 18 that needed to be decorated with sprinkles. The vanilla cupcake batch required her to bake 80 cupcakes. The strawberry batch had 10 more cupcakes to be baked than the chocolate batch. Each batch manager also w...
def solve() -> int: chocolate_decorated = 18 vanilla_baked = 80 strawberry_baked = chocolate_decorated + 10 special_cupcakes = 5 total_cupcakes = chocolate_decorated + vanilla_baked + strawberry_baked + special_cupcakes result = total_cupcakes return result
Student: 3. If Ajay has $20 and he spends 3 times as much on books as clothes, how much total money did he spend?
def solve() -> int: money = 20 clothes = 0 books = 0 clothes = money / 4 books = clothes * 3 result = clothes + books return result
The discount given on a book was 20% and the original cost of the book was $50. What is the selling price of the book?
def solve() -> int: original_cost = 50 discount = 0.20 discount_amount = original_cost * discount selling_price = original_cost - discount_amount result = selling_price return result
Student: A company produces 5000 jars of jam each month. Each jar costs $2 and the company's fixed and variable costs add up to $7000. How much profit will the company make in a year, assuming they produce the same number of jars each month?
def solve() -> int: fixed_cost = 7000 variable_cost = 2 * 5000 total_cost = fixed_cost + variable_cost revenue = 2 * 5000 profit = revenue - total_cost yearly_profit = profit * 12 result = yearly_profit return result
Lila works as a receptionist and earns $18 per hour. She needs to earn at least $1200 for her monthly expenses. She can work for 5 hours every weekday and 6 hours on a Saturday. How many weeks does it take for Lila to earn enough to cover her monthly expenses?
def solve() -> int: hourly_rate = 18 weekday_hours = 5 saturday_hours = 6 monthly_expenses = 1200 weekday_earnings = weekday_hours * hourly_rate * 5 saturday_earnings = saturday_hours * hourly_rate weekly_earnings = weekday_earnings + saturday_earnings weeks_needed = monthly_expense...
If a recipe calls for 2 cups of sugar and you want to make half the recipe, how many cups of sugar do you need?
def solve() -> int: original_sugar = 2 scale_factor = 0.5 half_sugar = original_sugar * scale_factor result = half_sugar return result
A recipe needs 2 cups of sugar and 3 cups of flour. If Peter wants to make 5 batches, how much sugar and flour does he need in total?
def solve() -> int: sugar_per_batch = 2 flour_per_batch = 3 total_batches = 5 total_sugar = sugar_per_batch * total_batches total_flour = flour_per_batch * total_batches result = (total_sugar, total_flour) return result
A baker can make 12 loaves of bread in one hour. How many loaves of bread can the baker make in 3.5 hours?
def solve() -> int: loaves_per_hour = 12 hours = 3.5 loaves_in_3_5_hours = loaves_per_hour * hours result = loaves_in_3_5_hours return result
Nathan is working on a project that requires him to paint a rectangular room with two coats of paint. The room has a width of 30 feet and a length of 25 feet. Each coat of paint requires 1 gallon of paint. How many gallons of paint does Nathan need?
def solve() -> int: length = 25 width = 30 area = length * width two_coats = 2 total_gallons = area * two_coats result = total_gallons return result
A teacher gave each student 3 pencils and had 10 pencils left over. If there were 29 students in the class, how many pencils did the teacher have to start with?
def solve() -> int: students = 29 leftover_pencils = 10 pencils_per_student = 3 total_pencils = (students * pencils_per_student) + leftover_pencils result = total_pencils return result
An electrician earns $15 per hour and works 45 hours a week. If she pays $1400 in rent each month, $400 in car payments, and $300 in insurance per month, calculate the amount of money the electrician has left after paying the expenses.
def solve() -> int: total_hourly_earning = 15 * 45 total_rent = 1400 total_car_payment = 400 total_insurance = 300 total_money_left = total_hourly_earning - (total_rent + total_car_payment + total_insurance) result = total_money_left return result
John saved 36 coins and Maria saved 48 coins. How many coins did they save together?
def solve() -> int: total_saved_coins = 36 + 48 result = total_saved_coins return result
A toy store has twice as many dolls as toy cars, and they have a total of 54 toys. Calculate the number of toy cars in the store.
def solve() -> int: number_of_dolls = 2 total_toys = 54 number_of_cars = (total_toys/(number_of_dolls+1))*1 result = number_of_cars return result
Kevin has 8 meters of rope that he wants to cut into some pieces. If 0.6 meters of rope are left after Kevin cuts each piece to be 0.4 meters long, find out how many pieces he cut?
def solve() -> int: rope = 8 piece = 0.4 remainder = 0.6 rope_used = rope - remainder pieces = rope_used / piece result = pieces return result
If a car travels 45 miles per hour, how many miles will it travel in 3.5 hours?
def solve() -> int: distance = 45 * 3.5 result = distance return result
At a basketball game, nine players were on the court before two more were subbed in. Shortly after, one of them got a cramp and left the game. How many players were left on the court?
def solve() -> int: players_on_court = 9 subbed_in = 2 players_on_court += subbed_in players_on_court -= 1 result = players_on_court return result
Carlos has a bag of 24 marbles. He wants to share them equally with his three friends. How many marbles will each person get and how many will be left in the bag?
def solve() -> int: share = 24 // 3 left = 24 % 3 result = "Carlos will give " + str(share) + " marbles to each of his friends and have " + str(left) + " marbles left in the bag." return result
arah spent $120 at the grocery store. If she bought 10 items and each item costed the same amount, how much did each item cost?
def solve() -> int: total_cost = 120 num_items = 10 cost_per_item = total_cost / num_items result = cost_per_item return result
``` In a class of 30 students, 18 students play football and 16 students play basketball. What is the probability that a student chosen at random does not play either football or basketball?
def solve() -> int: total_students = 30 football_players = 18 basketball_players = 16 neither_football_nor_basketball = total_students - (football_players + basketball_players) prob_of_neither = neither_football_nor_basketball / total_students result = round(prob_of_neither, 2) return result...
A flower shop buys 30 more roses than tulips every day. If the flower shop buys 80 tulips every day, how many roses and tulips will it buy in a month? Assume that a month has 30 days.
def solve() -> int: tulips = 80 roses = tulips + 30 days = 30 total_tulips = tulips * days total_roses = roses * days result = (total_tulips, total_roses) return result
A bus can go 40 miles in one hour. After driving for 4 hours, the bus takes a rest for 45 minutes. How many miles can the bus go in 12 hours?
def solve() -> int: speed = 40 time_driving = 4 time_resting = 45/60 total_time = 12 distance_driven = speed * time_driving distance_resting = 0 if time_resting > 0: distance_resting = speed * time_resting total_distance = distance_driven + distance_resting ...
A group of friends went to a restaurant and the total bill was $240. They want to leave a 15% tip. How much should each person pay if there are 8 people in the group?
def solve() -> int: total_bill = 240 tip_percentage = 0.15 bill_w_tip = total_bill*(1+tip_percentage) people = 8 amount_per_person = bill_w_tip/people result = amount_per_person return result
A rectangular prism has dimensions of 5 cm by 4 cm by 3 cm. What is the volume of the prism?
def solve() -> int: length = 5 width = 4 height = 3 volume = length * width * height result = volume return result
A bike ride is 20 km long and takes 1 hour and 10 minutes to complete. What is the average speed of the biker in km/h?
def solve() -> int: distance = 20 time_minutes = 70 time_hours = time_minutes / 60 speed = distance / time_hours result = speed return result
Student: 1. A farmer harvested 100 bushels of apples from his orchard. He sold 1/4 of them to a market, used 1/5 to make a pie and gave away 1/10 to his neighbor. How many bushels of apples did he have left?
def solve() -> int: apples_harvested = 100 sold_to_market = apples_harvested * 1/4 apples_left = apples_harvested - sold_to_market used_for_pie = apples_harvested * 1/5 apples_left = apples_left - used_for_pie given_to_neighbor = apples_harvested * 1/10 apples_left = apples_left - given_to_n...
Student: A toy store offers a 20% discount on all toys. If a customer buys two toys for $15 each, how much will they have to pay?
def solve() -> int: price_per_toy = 15 discount_percentage = 0.2 number_of_toys = 2 total_price_before_discount = price_per_toy * number_of_toys discount = total_price_before_discount * discount_percentage total_price_after_discount = total_price_before_discount - discount result = total_pri...
Student: A recipe calls for 2 and 1/3 cups of flour. If you want to make half the recipe, how many cups of flour do you need?
def solve() -> int: original_amount = 2 + 1/3 half_amount = original_amount / 2 result = half_amount return result
An apple costs 50 cents and a banana costs 30 cents. If you buy 5 apples and 10 bananas, what is the total cost?
def solve() -> int: apple_cost = 0.5*5 banana_cost = 0.3*10 total_cost = apple_cost + banana_cost result = total_cost return result
san is three times as old as her brother. In 5 years, she will only be twice as old. How old is Susan's brother now?
def solve() -> int: age_of_susan = 5*2 age_of_brother = age_of_susan//3 age_of_brother = age_of_brother - (age_of_susan-age_of_brother)*2 result = age_of_brother return result
Hannah, Jack, and Olivia collected 48 seashells. If Jack and Olivia collected the same number of seashells and Hannah collected 16, how many seashells did Olivia collect?
def solve() -> int: hannah_seashells = 16 total_seashells = 48 jack_olivia_seashells = (total_seashells - hannah_seashells) / 2 olivia_seashells = jack_olivia_seashells result = olivia_seashells return result
Tom is planning a vacation. He has $1000 to spend and wants to go somewhere that costs $200 per night. How many nights can he stay on vacation? A baker made 36 cupcakes to sell for the day. During the morning, he sold 15 cupcakes. In the afternoon, the baker baked an additional 10 cupcakes. How many cupcakes does the b...
def solve() -> int: budget = 1000 cost_per_night = 200 nights = budget // cost_per_night total_cupcakes = 36 morning_sales = 15 afternoon_bake = 10 remaining_cupcakes = total_cupcakes - morning_sales + afternoon_bake result = (nights, remaining_cupcakes) return result
A circle has a radius of 5 cm. Find its circumference.
def solve() -> int: pi = 3.14159 radius = 5 circumference = 2*pi*radius result = circumference return result
Student: If Simone can trim a hedge in 10 minutes, how long will it take her to trim a hedge that is 16 feet long and 4 feet wide?
def solve() -> int: trim_rate = 10 / (16 * 4) area = 16 * 4 time = area * trim_rate result = time return result
A company charges 50 dollars per hour for programming services. If a project takes 200 hours to complete, but they give a 20% discount, what is the final cost of the project?
def solve() -> int: hours = 200 hourly_rate = 50 discount_rate = 0.2 cost_before_discount = hours * hourly_rate discount = cost_before_discount * discount_rate cost_after_discount = cost_before_discount - discount result = cost_after_discount return result
A group of 27 people were travelling. One-fourth of them took the train, one-third of the rest took a bus, and the rest went by car. If 6 people went by car, how many people took the bus?
def solve() -> int: total_people = 27 train_people = total_people * 1/4 remaining_people = total_people - train_people bus_people = remaining_people * 1/3 car_people = 6 bus_people_final = bus_people - car_people result = bus_people_final return result
During her vacation, Julie visits the zoo for 4 days. On each day, she buys a bag of peanuts for $3.00. She also visits the aquarium for 2 days. On each day, she buys a small bag of fish food for $2.50. If each zoo and aquarium ticket is $10, how much does Julie spend on her trip?
def solve() -> int: zoo_days = 4 aquarium_days = 2 peanuts_price = 3.00 fish_food_price = 2.50 ticket_price = 10.00 zoo_spending = zoo_days * peanuts_price aquarium_spending = aquarium_days * fish_food_price total_spending = zoo_spending + aquarium_spending + (zoo_days + aquarium_da...
Student: Ali bought a pack of 24 crayons for $6. He used 6 crayons for a school project and gave 3 crayons to his friend. He then sold the remaining crayons for 50 cents each. How much profit or loss did he make from the crayon deal?
def solve() -> int: cost_of_pack = 6 number_of_crayons_in_pack = 24 number_of_crayons_used = 6 number_of_crayons_given_away = 3 price_of_each_crayon = 0.5 number_of_crayons_left = number_of_crayons_in_pack - number_of_crayons_used - number_of_crayons_given_away total_cost_of_crayons = cost_o...
David and his colleagues purchase office supplies. The total cost of the supplies is $800. There are 4 people in the group. David pays one-third of the total cost. How much does David pay?
def solve() -> int: total_cost = 800 num_people = 4 david_share = total_cost / num_people * (1/3) result = david_share return result
5. When making coffee, Jacob requires 36 kg of coffee beans to make 3 liters of coffee. How many kilos of coffee beans are needed to make 4 liters of coffee?
def solve() -> int: beans_needed_for_3_l = 36 result = beans_needed_for_3_l * (4/3) return result
A vegetable seller has 12 crates of tomatoes. Each crate has 20 kg of tomatoes. If each customer buys 3 kg of tomatoes, how many customers can the vegetable seller serve?
def solve() -> int: total_kg_tomatoes = 12 * 20 customers = total_kg_tomatoes / 3 result = customers return result
A store sold 50 t-shirts and 75 pants. If they sold half of the t-shirts and 40 pants, how many clothes do they have left?
def solve() -> int: t_shirts = 50 pants = 75 t_shirts_sold = t_shirts / 2 pants -= 40 total_clothes = t_shirts_sold + pants result = total_clothes return result
A pizza has a diameter of 12 inches. What is the circumference of the pizza, rounded to the nearest inch?
def solve() -> int: diameter = 12 radius = diameter / 2 pi = 3.14159 circumference = 2 * pi * radius rounded_circumference = round(circumference) result = rounded_circumference return result
Robert collects nuts for 12 hours and finds 676 of them. How many nuts did Robert find per hour?
def solve() -> int: nuts = 676 time = 12 result = nuts/time return result
Amy sells lemonade at a stand for $0.50 per cup. She makes 20 cups of lemonade every day and sells them all. She spends $0.10 on each cup of lemonade for ingredients and supplies. The next day, she decides to raise the price to $0.75 per cup, but she only sells 16 cups. How much more or less profit did Amy make on the ...
def solve() -> int: price_day1 = 0.50 cost_day1 = 0.10 quantity_day1 = 20 profit_day1 = (price_day1 - cost_day1) * quantity_day1 price_day2 = 0.75 cost_day2 = 0.10 quantity_day2 = 16 profit_day2 = (price_day2 - cost_day2) * quantity_day2 profit_difference = profit_day2 - profit_day1...
Leo's average for the first three coding quizzes was an 82. If he got an 86 on the third quiz, what was his average for the first two quizzes?
def solve() -> int: quiz1 = 82 quiz2 = 82 quiz3 = 86 average = (quiz1 + quiz2 + quiz3) / 3 average_first_two_quizzes = (average * 3 - quiz3) / 2 result = average_first_two_quizzes return result
Anna is a stockbroker. She earns a 1.5% commission on each share sold. She sold shares of three different companies during May: A, B and C. The shares of company A sold for $50, company B shares sold for $75 and company C shares sold for $125. What was Anna’s total commission for the shares she sold?
def solve() -> int: a_price = 50 b_price = 75 c_price = 125 a_commission = a_price * 0.015 b_commission = b_price * 0.015 c_commission = c_price * 0.015 total_commission = a_commission + b_commission + c_commission result = total_commission return result
In a classroom, there are 35 pencils, 18 pens, and 28 erasers. If Emily takes away 3 pencils, and Alex takes away 4 pencils and twice as many pens as the number of pencils that he removed, then calculate the total number of writing instruments that remained in the classroom.
def solve() -> int: pencils = 35 pens = 18 erasers = 28 pencils -= 3 pencils_removed = 4 pens_removed = pencils_removed * 2 pencils -= pencils_removed pens -= pens_removed total = pencils + pens + erasers result = total return result
A car travels 75 miles in 1.5 hours. What is its average speed in miles per hour?
def solve() -> int: distance = 75 time = 1.5 result = distance/time return result
A rectangle is 5 centimeters shorter than twice its width. If the perimeter of the rectangle is 36 cm, what is the length of the rectangle?
def solve() -> int: width = 0 length = 0 perimeter = 36 width = (perimeter - 10) / 6 length = 2 * width - 5 result = length return result
Student: Q1: Nancy is playing a board game with her friends, and they have 3 die. She rolls all 3 die and adds up the numbers for each roll. what is the probability of rolling 10 points in total?
def solve() -> int: die1 = 0 die2 = 0 die3 = 0 result = 3/216 return result
Student: Maryann can solve 10 calculus problems in 30 minutes and 6 statistics problems in 20 minutes. How many calculus problems can she solve in the same amount of time that she can solve 24 statistics problems?
def solve() -> int: calculus_time = 30 calculus_problems = 10 statistics_time = 20 statistics_problems = 6 total_statistics_time = 24 / statistics_problems * statistics_time result = total_statistics_time / calculus_time * calculus_problems return result
The Brown family goes for a hike every weekend for 6 weeks. If they take 3 granola bars each and a box of granola bars has 12 in it, how many boxes of granola bars should they bring?
def solve() -> int: bars = 3 * 4 box = 12 boxes = bars / box result = boxes return result
Student: John invests $500 in a stock for 3 years with an annual interest rate of 6%. What is the value of his investment after 3 years?
def solve() -> int: principal = 500 interest_rate = 0.06 time = 3 result = principal * (1 + interest_rate) ** time return result
Student: 5. If Michele has 750 beads, and she uses 10 beads per necklace, how many necklaces can Michele make?
def solve() -> int: beads = 750 beads_per_necklace = 10 necklaces = beads // beads_per_necklace result = necklaces return result
==================== Alex wants to buy a new bike that costs $180. He has saved up $120 so far. He earns $15 for each hour of babysitting. How many hours of babysitting does Alex need to do to afford the bike?
def solve() -> int: cost = 180 saved = 120 earn = 15 difference = cost - saved hours = difference / earn result = hours return result
Manny has three times as much fruit as does Lexi. Together, they have 48 fewer fruit than Jacob. If Lexi has 72 fruit, how much fruit do the three have altogether?
def solve() -> int: x = None y = 72 z = None x = 3*y - 48 z = x + 48 result = x + y + z return result
A student has to write a paper for their course and the professor will award grades in the form a total of 150 points. If the student finishes with a score of 72 points, how many percentage did the student score for the paper?
def solve() -> int: total_points = 150 student_points = 72 percent_score = (student_points/total_points) * 100 result = percent_score return result
A group of friends went on a trip. They stayed in a hotel for 6 nights and paid a total of $1200. If the cost of each night changes every day and increases by $25 every 2 days, how much did they pay on their 3rd night?
def solve() -> int: total_nights = 6 total_amount = 1200 first_night_cost = (total_amount - (25 * ((total_nights-1)*total_nights)//4))//total_nights third_night_cost = first_night_cost + 50 result = third_night_cost return result
Peter has $20. If he spends 25% of his money on candy and 40% of his money on toys, how much money does he have left?
def solve() -> int: starting_money = 20 spent_on_candy = starting_money * 0.25 spent_on_toys = starting_money * 0.40 money_left = starting_money - spent_on_candy - spent_on_toys result = money_left return result
Accountant David is processing 50 invoices. One-tenth of the invoices require special attention, which increases the processing time by 30%. If it takes him 2 minutes to process each invoice, how long will it take David to process all of them?
def solve() -> int: invoices = 50 special_invoices = invoices / 10 normal_invoices = invoices - special_invoices special_processing_time = 2 * 1.3 normal_processing_time = 2 total_processing_time = (special_invoices * special_processing_time) + (normal_invoices * normal_processing_time...
Student: You want to save $10,000 in 3 years by depositing money into a savings account that offers a 3% annual interest rate. How much money do you need to deposit each year?
def solve() -> int: years = 3 target_amount = 10000 interest_rate = 0.03 deposit_amount = target_amount / ((1 + interest_rate) ** years - 1) / (interest_rate / (1 + interest_rate)) result = deposit_amount return result
A pack of gum has 12 pieces. Alice, Bob, and Charlie share a pack of gum equally. How many pieces of gum does each person get?
def solve() -> int: pieces = 12 / 3 result = pieces return result
In a class of 25 students, 15% are boys. How many girls are in the class?
def solve() -> int: total = 25 boys = total*15/100 girls = total - boys result = girls return result
Ernie wants to know how many miles he drove if he went at a speed of 45 miles per hour for 40 minutes.
def solve() -> int: speed = 45 time = 40 distance = speed * time result = distance return result
Student: Twice a year, Mary goes to her doctor for checkups. The first visit was 9 months ago and the results showed her weight was 140 lbs. When she visited the doctor yesterday, she weighed 144 lbs. How much did she gain during the intervening time period?
def solve() -> int: weight_initial = 140 weight_final = 144 time_period = 9 weight_gain = weight_final - weight_initial weight_gain_per_month = weight_gain / time_period result = weight_gain_per_month return result
The price of a bike was originally $200, but it was marked down by 20%. What is the new price of the bike?
def solve() -> int: original_price = 200 discount_rate = 0.2 new_price = original_price - (original_price * discount_rate) result = new_price return result
It takes 2 hours for a boat to travel 220 km on a river at an average speed of 65km/hr. How long in hours will it take for the boat to travel 120km of the same route?
def solve() -> int: original_distance = 220 original_time=2 speed=65 total_distance_needed = 120 total_time_needed = (total_distance_needed*original_time) / original_distance result = total_time_needed return result
A car going 60 miles per hour takes three hours to reach a destination. Another car going 80 miles per hour reaches the same destination in 2 hours. How long would it take for the two cars to reach the destination if they started at the same time?
def solve() -> int: speed_car1 = 60 time_car1 = 3 speed_car2 = 80 time_car2 = 2 distance_car1 = speed_car1 * time_car1 distance_car2 = speed_car2 * time_car2 total_distance = distance_car1 + distance_car2 combined_speed = speed_car1 + speed_car2 time_combined = to...
Sarah makes her own smoothies. She makes it in batches of 1 liter. She drinks 500 ml of smoothie every day. It takes 10 minutes to make smoothie. How much time will she spend making smoothie in 15 days?
def solve() -> int: batch_size = 1 daily_consumption = 0.5 time_per_batch = 10 days = 15 total_smoothie_needed = daily_consumption * days total_batches_needed = total_smoothie_needed / batch_size total_time_needed = total_batches_needed * time_per_batch result = total_time_n...
At a gas station, there are 20 employees. 15 of them work as attendants and earn $12 per hour. Of the rest, 2 work as mechanics and earn $25 per hour. All others work as managers and earn $30 per hour. What is the total cost of employing all these people for a 8-hour long shift?
def solve() -> int: employees = 20 attendants = 15 mechanics = 2 managers = employees - attendants - mechanics attendant_hourly_rate = 12 mechanic_hourly_rate = 25 manager_hourly_rate = 30 attendant_cost = attendants * attendant_hourly_rate * 8 mechanic_cost = mechanics * m...
In a city, 35% of the households have a car. If there are 1000 households in the city and the number of male-owned cars is twice that of female-owned cars, how many female-owned cars are there in the city?
def solve() -> int: households = 1000 car_percentage = 0.35 female_cars = households * car_percentage / 3 male_cars = 2 * female_cars result = female_cars return result
Here are some possible questions with python programs: Alex has 4 times as many stickers as Ben. Alex then gives away 8 stickers to his friend. If Ben has 6 stickers, how many does Alex have left?
def solve() -> int: Alex = 4 * 6 Alex = Alex - 8 result = Alex return result
There are 20 small boxes of wine, each containing 6 bottles. If 4 small boxes can fit in one big box and there are 35 big boxes, how many bottles are there in all small boxes?
def solve() -> int: small_boxes = 20 bottles_per_box = 6 big_boxes = 35 small_boxes_per_big_box = 4 total_small_boxes = big_boxes * small_boxes_per_big_box total_bottles = total_small_boxes * bottles_per_box result = total_bottles return result
6. Steve was tasked with walking his neighbor's four dogs. Each of the dogs weighed 25 pounds and had to be walked for 15 minutes each. How much weight did Steve end up carrying for the entire dog walk?
def solve() -> int: total_weight = 0 for i in range(0, 4): total_weight += 25 result = total_weight return result
A wall has a height of 8 feet and a length of 12 feet. If a can of paint can cover 20 square feet, how many cans of paint are needed to cover the wall?
def solve() -> int: height = 8 length = 12 area = height * length sq_ft_per_can = 20 num_cans = area / sq_ft_per_can result = num_cans return result
If a rectangle has a length of 7 inches and a width of 5 inches, what is its area in square inches?
def solve() -> int: length = 7 width = 5 area_rectangle = length * width result = area_rectangle return result
If a recipe calls for 2 eggs for every 3 cups of flour, how many cups of flour are needed for 8 eggs?
def solve() -> int: eggs_needed = 2 flour_to_eggs_ratio = 3 / 2 eggs_available = 8 flour_needed = eggs_available * (1 / eggs_needed) * flour_to_eggs_ratio result = flour_needed return result
Lily spent 1/4 of her savings on school supplies, then spent $15 on a new dress. If she has $48 remaining, how much did she initially have in her savings account?
def solve() -> int: remaining = 48 dress = 15 savings_after_dress = remaining + dress savings_before_schoolsupplies = 4 * savings_after_dress result = savings_before_schoolsupplies return result
A baker made 24 muffins in an hour. He sold 3/4 of them in the first 15 minutes, and then made 18 more muffins in the next 15 minutes. He sold 2/3 of the total muffins he had in the next 15 minutes, and then made 12 more muffins in the last 15 minutes. What was the average rate of muffins he sold per minute for the dur...
def solve() -> int: muffins_sold = 24 * 3 / 4 muffins = 24 - muffins_sold + 18 muffins_sold = muffins_sold + muffins * 2 / 3 muffins = muffins - muffins * 2 / 3 + 12 muffins_sold = muffins_sold + muffins average = muffins_sold / 60 result = average return result
In a can of 360 soda cans, if one-third of the can is sold in 2 days, how many soda cans are sold in one day?
def solve() -> int: cans_in_can = 360 sold_in_2_days = cans_in_can / 3 sold_in_1_day = sold_in_2_days / 2 result = sold_in_1_day return result
A rectangle has length 10 cm and area 60 cm^2. What is the width of the rectangle?
def solve() -> int: length = 10 area = 60 width = area / length result = width return result
A grocer wants to make a 20% profit on her wholesale price. If she sells a product for $48, what was the wholesale price?
def solve() -> int: sale_price = 48 profit_margin = 0.20 wholesale_price = sale_price / (1 + profit_margin) result = wholesale_price return result
Tom is ordering a pizza. He knows that a large pizza has a diameter of 18 inches. If he wants to make 12 slices, what is the angle between each slice?
def solve() -> int: diameter = 18 slices = 12 totalAngle = 360 sliceAngle = totalAngle/slices result = sliceAngle return result
Possible questions and programs: A library is holding a book sale where customers can buy books for half the original price. The original prices of books are $8 for hardcovers and $5 for paperbacks. Twelve customers buy hardcovers and nine buy paperbacks. The library donates a quarter of the money they made from the sa...
def solve() -> int: hardcover_original = 8 hardcover_discounted = hardcover_original / 2 paperback_original = 5 paperback_discounted = paperback_original / 2 hardcovers_sold = 12 hardcovers_cost = hardcover_discounted * hardcovers_sold paperbacks_sold = 9 paperbacks_cost = paperback...
Peter spent 3/5 of his money on a trip and 1/4 of the rest on souvenirs. He then spent $60 on food and had $120 left. How much money did he save originally?
def solve() -> int: total_money = (120+60)/(1-(3/5)*(3/4)) result = total_money return result
-Choice of numbers is arbitrary. Possible new questions and programs are: Mario is making pizzas for a party. He needs 12 slices of cheese for each pizza, and each slice weighs 25 g. How many kilograms of cheese does he need to buy to make 80 pizzas?
def solve() -> int: total_slices = 12 * 80 total_grams = total_slices * 25 total_kilograms = total_grams / 1000 result = total_kilograms return result
Luis sells seashells in his store. On Friday, he sold 15 seashells, and on Saturday, he sold half as many seashells as he did on Friday. On Sunday, Luis sold one-third the number of seashells he sold on Saturday. How many seashells did Luis sell over the weekend?
def solve() -> int: friday_seashells = 15 saturday_seashells = friday_seashells / 2 sunday_seashells = saturday_seashells / 3 total_seashells_sold = friday_seashells + saturday_seashells + sunday_seashells result = total_seashells_sold return result
A fruit seller buys 1200 oranges for $600. He sells each orange for $0.75. However, 10% of the oranges are spoiled and cannot be sold. How much profit or loss will the fruit seller make from selling the oranges?
def solve() -> int: good_oranges = 1200 * 0.9 revenue = good_oranges * 0.75 cost = 1200 * 0.5 profit_loss = revenue - cost result = profit_loss return result
Josh bought a set of paints for $60, brushes for $20, and a canvas for $15. In order to enter an art contest, he needs to frame his artwork which will cost him $30. How much did Josh spend in total to enter the contest?
def solve() -> int: paints_price = 60 brushes_price = 20 canvas_price = 15 frame_price = 30 total_spent = paints_price + brushes_price + canvas_price + frame_price result = total_spent return result
Student: A cuboid has a length of 14 centimeters, a width of 7 centimeters and a height of 4 centimeters. What is the surface area of the cuboid rounded to the nearest whole number?
def solve() -> int: length = 14 width = 7 height = 4 surface_area = 2 * (length * width + length * height + width * height) result = round(surface_area) return result
The farm has 50 pigs. If each pig eats 3 kg of feed a day and one bag of feed weighs 50 kg, how many bags of feed are consumed in a month?
def solve() -> int: pigs = 50 feed_per_pig_per_day = 3 feed_bag_weight = 50 days = 30 total_feed = pigs * feed_per_pig_per_day * days total_bags = total_feed // feed_bag_weight + (total_feed % feed_bag_weight > 0) result = total_bags return result
At Cheese Craze, cheese costs $6 per pound with a 8-pound minimum. If Cindy spent $66 on cheese, how many pounds over the minimum did she purchase?
def solve() -> int: min_cost = 8 * 6 extra_cost = 66 - min_cost extra_pounds = extra_cost / 6 result = extra_pounds return result
Fred eats twice as many candies as Jenny. If together they eat 21 candies, how many candies does Fred eat?
def solve() -> int: total_candies = 21 fred_to_jenny_candies = 2 fred_candies = total_candies / (1 + fred_to_jenny_candies) result = fred_candies return result