question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A store offers a discount of 20% on all items. If an item originally costs $50, what is the final price of the item after the discount?
def solve() -> int: original_price = 50 discount_percent = 20 discount_amount = (discount_percent/100) * original_price final_price = original_price - discount_amount result = final_price return result
Larry's private jet can hold up to 1500 liters of fuel. If he is traveling for a total of 9000 kilometers and his jet consumes 100 liters of fuel per 1000 kilometers, how many times does he need to refuel for the round trip?
def solve() -> int: jet_fuel_capacity = 1500 total_distance = 9000 fuel_consumption_per_distance = 100 fuel_required = (total_distance / 1000) * fuel_consumption_per_distance refuel_times = fuel_required / jet_fuel_capacity result = refuel_times return result
There are 14 more cars than seven times the number of bikes in a parking lot. If there are 8 bikes in the parking lot, how many cars are there?
def solve() -> int: cars = 0 bikes = 8 cars = 7 * bikes + 14 cars = 7 * 8 + 14 result = cars return result
A chef can cook a steak in 10 minutes, a chicken in 15 minutes, and a lobster in 20 minutes. If the chef has to cook 5 steaks, 3 chickens, and 2 lobsters, how long will it take him to cook all the dishes?
def solve() -> int: time_steak = 10*5 time_chicken = 15*3 time_lobster = 20*2 total_time = time_steak + time_chicken + time_lobster result = total_time return result
Student: A cake can be decorated with 5 different types of icing and 6 different types of fruit. If each cake must have exactly 2 types of icing and 3 types of fruit, how many different cakes can be made?
def solve() -> int: icing_types = 5 fruit_types = 6 num_icing_combinations = icing_types * (icing_types - 1) // 2 num_fruit_combinations = fruit_types * (fruit_types - 1) * (fruit_types - 2) // 6 total_cakes = num_icing_combinations * num_fruit_combinations result = total_cakes return resul...
A store is selling board games at a rate of $57 each. If the store has sold a total of $3,892 worth of games, how many board games have been sold?
def solve() -> int: rate = 57 total_sales = 3892 num_games = 0 num_games = total_sales / rate result = num_games return result
A triangle has a base of 12 inches, and a height of 8 inches. What is the area of the triangle?
def solve() -> int: base = 12 height = 8 area = 0.5 * base * height result = area return result
Bob put his laundry in the dryer that needed to dry for 60 minutes. He took them out after 10 minutes. How much time was left to dry?
def solve() -> int: total_drying_time = 60 time_passed = 10 time_left = total_drying_time - time_passed result = time_left return result
Kathy invested $4,000 in a business 3 years ago and is expecting to make a 20% return on it in the next year. What is the expected total return at the end of the next year?
def solve() -> int: initial_investment = 4000 time = 3 rate = 0.2 expected_return = initial_investment * (1 + rate)**time result = expected_return return result
arah wants to travel to another state for a weekend trip. A round-trip train ticket costs $100. She also needs to pay $50 per night for a hotel. If she will stay for 3 nights, write a program that calculates the total cost of her trip.
def solve() -> int: train_ticket_price = 100 num_nights = 3 hotel_price_per_night = 50 total_hotel_price = num_nights * hotel_price_per_night total_trip_cost = train_ticket_price + total_hotel_price result = total_trip_cost return result
Student: Isaac makes $6000 a month. His monthly bills include $2000 in rent, $300 in utilities, $500 in groceries, $400 in car payments, and $250 in miscellaneous expenses. If he wants to save $800 every month for a year, how much money does he have every month for entertainment and dining out?
def solve() -> int: rent = 2000 utilities = 300 groceries = 500 car_payments = 400 miscellaneous = 250 income = 6000 savings = 800 total_expenses = rent + utilities + groceries + car_payments + miscellaneous leftover = income - total_expenses - savings result = leftover retu...
Student: Two athletes were running an 800m sprint. After the race, the first athlete had an average running speed of 5 seconds per 100m while the other one had an average of 4.7 seconds per 100m. Who ran the race faster?
def solve() -> int: distance = 800 speed_1 = 5 speed_2 = 4.7 time_1 = 0 time_2 = 0 time_1 = distance * speed_1 / 100 time_2 = distance * speed_2 / 100 result = time_2 < time_1 return result
A grocery store sells apples for $1.50 per pound and oranges for $2.00 per pound. Rachel bought 2 pounds of apples and 3 pounds of oranges. Sales tax is 10%. How much did Rachel pay including tax?
def solve() -> int: price_per_pound_apples = 1.5 price_per_pound_oranges = 2 amount_apples = 2 amount_oranges = 3 tax_rate = 0.1 subtotal = price_per_pound_apples*amount_apples + price_per_pound_oranges*amount_oranges tax = tax_rate * subtotal total_price = subtotal + tax result = to...
Jessica is constructing a fence that is 50 feet long, 6 feet high, and 1 foot thick. Concrete costs $150 per cubic yard and has a density of 160 pounds per cubic foot. How much does the concrete for the fence cost?
def solve() -> int: length = 50 height = 6 thickness = 1 volume = length * height * thickness density = 160 pounds_per_cubic_yard = 2000 pounds = volume * density yards = pounds / pounds_per_cubic_yard cost_per_yard = 150 cost = yards * cost_per_yard ...
Susan is training to run a marathon. On the first day, she runs 3 miles. Each day afterward, she runs 2 more than the previous day. If she runs for 5 days, how many miles will she have run in total?
def solve() -> int: day = 1 total = 3 while day < 5: ran = total + 2 total += ran day += 1 result = total return result
Sam has 7 times as many balls as Sara. Sara has 4 times as many balls as Sean. If Sean has 3 balls, how many balls does Sam have?
def solve() -> int: sean = 3 sara = 4 * sean sam = 7 * sara result = sam return result
James's 10 friends went to see a movie together and the total admission cost was $75. How much did each person pay?
def solve() -> int: total_cost = 75 number_of_friends = 10 result = total_cost / number_of_friends return result
Student: Pamilla starts with 3 apples. On Monday she bought 6 more apples, on Tuesday she had 3 times as many apples than on Monday and on Wednesday she had 2 times as many apples than on Tuesday. How many apples does Pamilla have now?
def solve() -> int: apples = 3 apples = apples + 6 apples = apples * 3 apples = apples * 2 result = apples return result
Emma has a rectangular garden that measures 15 feet by 12 feet. She wants to plant some flowers along the perimeter of the garden. Each flower requires one square foot of space. How many flowers can Emma plant?
def solve() -> int: length = 15 width = 12 perimeter = 2 * (length + width) flowers = perimeter result = flowers return result
A runner completes a marathon in 4 hours and 10 minutes. What is the average pace in minutes per mile if a marathon is 26.2 miles long?
def solve() -> int: marathon_distance = 26.2 time_in_minutes = 4*60 + 10 pace_in_minutes_per_mile = time_in_minutes / marathon_distance result = pace_in_minutes_per_mile return result
A car travels at a speed of 60 km/h for 3 hours. How far did it travel in that time?
def solve() -> int: speed = 60 time = 3 distance = speed * time result = distance return result
Zoe had $27. She spent $10 on a jacket and $4 on gloves. Then, she found $6 on the street. Later, she earned $12 for washing her neighbor's car. How much money does Zoe have now?
def solve() -> int: zoe_money = 27 zoe_money = zoe_money - 10 - 4 zoe_money = zoe_money + 6 zoe_money = zoe_money + 12 result = zoe_money return result
Lauren buys new clothes every 3 months. It costs $300 and insurance covers 0%. How much does she pay per year?
def solve() -> int: months_per_year = 12 cost_per_clothes = 300 insurance_coverage = 0 clothes_per_year = months_per_year / 3 total_cost_per_year = clothes_per_year * cost_per_clothes * (1 - insurance_coverage) result = total_cost_per_year return result
Mike had 8 books in his shelf. Every month he added 4 more books. After how many months will he have 40 books in his shelf?
def solve() -> int: books_in_shelf = 8 books_added_per_month = 4 target_books = 40 months = (target_books - books_in_shelf) / books_added_per_month result = int(months) return result
Andrew is preparing for a movie marathon. He and his friends will each eat 2 bags of popcorn. There are 10 of them in total. It costs $4 for 3 bags of popcorn. How much will it cost to buy enough popcorn for everyone?
def solve() -> int: num_people = 10 bags_per_person = 2 total_bags = num_people * bags_per_person bags_per_pack = 3 packs_needed = total_bags // bags_per_pack + (total_bags % bags_per_pack > 0) cost_per_pack = 4 total_cost = packs_needed * cost_per_pack result = total_cost return res...
Emma had 5 notebooks, 7 pens, and 10 pencils. She received 4 notebooks, 6 pens, and 8 pencils as gifts. How many items does she have in all?
def solve() -> int: num_of_notebooks_owned = 5 num_of_pens_owned = 7 num_of_pencils_owned = 10 num_of_notebooks_received = 4 num_of_pens_received = 6 num_of_pencils_received = 8 total_items_owned = num_of_notebooks_owned + num_of_pens_owned + num_of_pencils_owned total_items_re...
Mason and Harper are knitting scarves for charity. Mason can knit 2 scarves in an hour while Harper can knit 1 scarf in 30 minutes. If they knit for 3 hours, how many scarves will they have knitted altogether?
def solve() -> int: mason_scarves_per_hour = 2 harper_scarves_per_hour = 2 total_hours = 3 mason_scarves = mason_scarves_per_hour * total_hours harper_scarves = harper_scarves_per_hour * total_hours total_scarves = mason_scarves + harper_scarves result = total_scarves ret...
Ned baked ten trays with 20 croissants in each tray. How many croissants did Ned bake?
def solve() -> int: tray = 10 croissants = 20 result = tray * croissants return result
Student: At a local store, Jevon sees 3 notebooks that are $3 each. How much money would he spend if he buys all three notebooks?
def solve() -> int: notebook_price = 3 num_notebooks = 3 total_cost = notebook_price * num_notebooks result = total_cost return result
Student: At the Busy Laundry, they have 240 clothes to wash. If they have 6 washing machines, and each washing machine can wash 12 clothes in 30 minutes, how many minutes will it take for them to wash all of the clothes?
def solve() -> int: clothes = 240 washing_machines = 6 clothes_per_machine = 12 minutes_per_machine = 30 total_minutes = washing_machines * minutes_per_machine total_clothes = washing_machines * clothes_per_machine remaining_minutes = (clothes - total_clothes) * minutes_per_machine resul...
An egg carton has 12 eggs. If it costs $2.49 for a carton of eggs, how much does one egg cost?
def solve() -> int: eggs_per_carton = 12 cost_per_carton = 2.49 cost_per_egg = cost_per_carton / eggs_per_carton result = cost_per_egg return result
Amy collects stamps. She has 200 stamps from Canada and 150 stamps from Australia. She decides to sell some of her stamps to a friend who pays $0.1 for each Canadian stamp and $0.15 for each Australian stamp. She sells 20% of her Canadian stamps and 40% of her Australian stamps. How much money did she make from selling...
def solve() -> int: canadian_sold = 200 * 0.2 australian_sold = 150 * 0.4 money_canadian = canadian_sold * 0.1 money_australian = australian_sold * 0.15 total_money = money_canadian + money_australian result = total_money return result
A store offers a 20% discount on all items. A shirt is originally priced at $25. What is the new price of the shirt with the discount?
def solve() -> int: original_price = 25 discount_percent = 20 discount = original_price * (discount_percent / 100) new_price = original_price - discount result = new_price return result
If a car uses 15 gallons of gasoline to drive 300 miles, how many gallons of gasoline will it use to drive 465 miles?
def solve() -> int: distance1 = 300 gasoline1 = 15 distance2 = 465 gasoline2 = (distance2 * gasoline1) / distance1 result = gasoline2 return result
A bookshelf has 4 shelves. Each shelf can hold 7 books. If the bookshelf is full, how many books are in it?
def solve() -> int: num_shelves = 4 books_per_shelf = 7 total_books = num_shelves * books_per_shelf result = total_books return result
John wants to buy a new bike. The bike costs $250. He has saved $150 so far and plans to save $30 every week until he can afford the bike. How many weeks will it take John to save enough money for the bike?
def solve() -> int: money_left_to_save = 250 - 150 weeks_needed = money_left_to_save / 30 result = weeks_needed return result
Student: Beth and her cousins collected 102 cookies at a carnival. Out of the 102 cookies, they ate 8 at the carnival and shared 10 with their neighbours. How many cookies did they have left?
def solve() -> int: cookies_collected = 102 cookies_eaten = 8 cookies_shared = 10 cookies_left = cookies_collected - cookies_eaten - cookies_shared result = cookies_left return result
Mike wants to distribute enough flower seeds for Earth Day. He has 100 friends, and each friend needs 3 seeds. A packet of seeds contains 50 seeds. How many packets of seeds does Mike need to buy, and how many seeds will be left over?
def solve() -> int: num_friends = 100 seeds_per_friend = 3 seeds_per_packet = 50 total_seeds_needed = num_friends * seeds_per_friend packets_needed = total_seeds_needed // seeds_per_packet seeds_left_over = total_seeds_needed % seeds_per_packet result = f'Mike needs to bu...
A recipe calls for 2 cups of flour and 1 cup of sugar. If a bag of flour costs $3 and a bag of sugar costs $4, how much would it cost to buy enough ingredients for three batches of the recipe?
def solve() -> int: flour_cup = 2 sugar_cup = 1 flour_cost = 3 sugar_cost = 4 amount_of_batches = 3 total_cost = (flour_cup*flour_cost + sugar_cup*sugar_cost) * amount_of_batches result = total_cost return result
Susan just bought a new car for $25,000. She made a down payment of 20% and took a car loan with an interest rate of 5% per annum for 5 years. Assuming she pays equal installments each year for the loan, what is the annual installment she has to pay?
def solve() -> int: down_payment = 25000 * 0.20 balance = 25000 - down_payment interest_rate = 0.05 term = 5 annual_interest = balance * interest_rate installment = (balance + annual_interest) / term result = installment return result
Ms. Chen is a librarian who's been assigned to catalog some books in the shelves. She counted 300 books in the fiction section and 400 books in the non-fiction section. She also noticed that 20% of the fiction books and 15% of the non-fiction books had missing or damaged labels. She wants to replace the labels for all ...
def solve() -> int: fiction_labels = 300 * 20 / 100 non_fiction_labels = 400 * 15 / 100 total_labels = fiction_labels + non_fiction_labels percentage = total_labels / (300 + 400) * 100 result = (total_labels, percentage) return result
Lisa is a theater director for a high school play. She gives 10 push-ups as punishment for forgetting lines, 5 less than four times that number of push-ups for arriving late, and 2/3 the number of late-arriving push-ups for not wearing the correct costume. If each push-up takes 10 seconds to complete, how much time do ...
def solve() -> int: num_forget_lines = 10 num_late_pushups = 4*num_forget_lines - 5 num_costume_pushups = 2/3*num_late_pushups total_pushups = num_forget_lines + num_late_pushups + num_costume_pushups total_time = total_pushups * 10 result = total_time return result
John has 120 marbles. He gave 3/5 of his marbles to Jane. If Jane gave back 1/4 of her marbles to John, how many marbles does John have now?
def solve() -> int: john_marbles = 120 jane_marbles = (3/5) * john_marbles john_marbles += (1/4) * jane_marbles result = john_marbles return result
A pizza place sells 300 pizzas in one day. 40% of the pizzas were pepperoni, 20% were mushroom, and 10% were both pepperoni and mushroom. How many pizzas were neither pepperoni nor mushroom?
def solve() -> int: pepperoni_pizzas = 300*0.4 mushroom_pizzas = 300*0.2 both_pizzas = 300*0.1 neither_pizzas = 300 - (pepperoni_pizzas + mushroom_pizzas - both_pizzas) result = neither_pizzas return result
Some possible new questions are: A rectangular garden is 15 feet long and 9 feet wide. Tom wants to fence it with a wire that costs $0.5 per foot. How much money does he need to buy the wire?
def solve() -> int: perimeter = 2 * (15 + 9) cost = perimeter * 0.5 result = cost return result
The circumference of a circle is 62.82 feet. What is the diameter of the circle in feet?
def solve() -> int: circumference = 62.82 pi = 3.14 diameter = circumference / pi result = diameter return result
Student: A train travels 360 kilometers at a speed of 60 kilometers per hour. How long did the trip take?
def solve() -> int: distance = 360 speed = 60 time = distance / speed result = time return result
An apple costs 75¢, a banana costs 50¢ and a pear costs 80¢. If Jack bought 7 pieces of fruit, how much did he pay?
def solve() -> int: apple_price = 0.75 banana_price = 0.50 pear_price = 0.80 num_apples = 3 num_bananas = 2 num_pears = 7 cost_apples = num_apples * apple_price cost_bananas = num_bananas * banana_price cost_pears = num_pears * pear_price result = cost_apples + cos...
Lily has 1000 grapes and 1/10 as many watermelons as grapes. Her cousins come over, and she gives each of them 1/20 of each fruit. How many fruits is Lily left with in total?
def solve() -> int: grapes = 1000 watermelons = grapes / 10 total_fruits = grapes + watermelons cousins = 4 grapes_per_cousin = grapes / 20 watermelons_per_cousin = watermelons / 20 total_fruits_given = cousins * (grapes_per_cousin + watermelons_per_cousin) fruits_left = total_fruits - ...
Kevin has 30 candy bars and wants to make gift bags for each of his 10 friends. How many candy bars should go in each bag?
def solve() -> int: number_of_friends = 10 number_of_candy_bars = 30 number_of_candy_bars_per_bag = number_of_candy_bars // number_of_friends result = number_of_candy_bars_per_bag return result
Ethan wants to go to a music festival that costs $350 for a ticket. He starts saving money two months in advance and puts aside $60 each month. How much does Ethan still need to save by the time of the festival?
def solve() -> int: ticket_cost = 350 months_to_save = 2 monthly_savings = 60 total_savings = months_to_save * monthly_savings remaining_cost = ticket_cost - total_savings result = remaining_cost return result
If a rectangle has a length of 8 and a width of 4, what is its perimeter?
def solve() -> int: perimeter = 2*8 + 2*4 result = perimeter return result
A rectangle has an area of 60 square meters and a perimeter of 34 meters. What are the dimensions of the rectangle?
def solve() -> int: area = 60 perimeter = 34 result = (12, 5) return result
Bob has a lemonade stand that sells each cup for $0.5. He spends $10 on lemons and sugar to make the lemonade. He sells 80 cups on the first day and 120 cups on the second day. How much profit did he make in total?
def solve() -> int: revenue = (80 + 120) * 0.5 cost = 10 profit = revenue - cost result = profit return result
Mary ran 48km in 8 hours and John ran 20km in 12 hours. What is the average speed of both Mary and John?
def solve() -> int: distance_mary = 48 time_mary = 8 distance_john = 20 time_john = 12 total_distance = distance_mary + distance_john total_time = time_mary + time_john average_speed = total_distance/total_time result = average_speed return result
Benjamin had 30 toy cars in his collection. He purchased an additional 12. But because of his negligence, he broke one-fourth of them. How many toy cars does he have now?
def solve() -> int: toy_cars = 30 additional_cars = 12 broken_cars = toy_cars / 4 total_cars = toy_cars + additional_cars - broken_cars result = total_cars return result
Student: Susan has 128 apples. She gave away 54 apples. How many apples does Susan have now?
def solve() -> int: apples_original = 128 apples_given_away = 54 apples_remaining = apples_original - apples_given_away result = apples_remaining return result
8. David started a new hobby and went fishing in the lake three times during the weekend. On the first day, he collected 3 fish in total, on the second day he collected 4 more than the first day, and on the third day, he collected five times the total amount he collected from the first two days. How many fish did David...
def solve() -> int: total_fish = 0 total_fish = 3 + (3 + 4) + (5 * (3 + 4)) result = total_fish return result
Lee has $16 and wants to buy a t-shirt that costs $6. How much money will he have left?
def solve() -> int: initial_amount = 16 price_of_t_shirt = 6 remaining_amount = initial_amount - price_of_t_shirt result = remaining_amount return result
William is trying to remember when his favorite actor was born. He knows the actor's younger brother was born in 1986, their older sister was born in 1989, and the gap between the actor and their sister is three times the gap between the actor's younger brother and their sister. What year was the actor born?
def solve() -> int: brother_birth_year = 1986 sister_birth_year = 1989 brother_sister_gap = sister_birth_year - brother_birth_year actor_sister_gap = 3 * brother_sister_gap actor_birth_year = sister_birth_year - actor_sister_gap result = actor_birth_year return ...
Anne has 32 erasers. If she gives away 5 erasers, how many erasers does she have left?
def solve() -> int: num_of_erasers_original = 32 num_of_erasers_given = 5 num_of_erasers_left = 0 num_of_erasers_left = num_of_erasers_original - num_of_erasers_given result = num_of_erasers_left return result
Kaya wants to buy 5 terracotta pots for her plants. Each pot cost $10. She also plans to buy 12 succulents, each succulent cost $2. How much will Kaya spend in total?
def solve() -> int: number_pots = 5 price_per_pot = 10 number_succulents = 12 price_per_succulent = 2 pot_cost = number_pots * price_per_pot succulent_cost = number_succulents * price_per_succulent result = pot_cost + succulent_cost return result
A square has a perimeter of 24cm. What is the length of one of its sides?
def solve() -> int: perimeter = 24 side_length = perimeter / 4 result = side_length return result
Ella draws six times as many pictures as Zoe writes stories. If Zoe writes 10 stories, how many pictures and stories do Ella and Zoe draw and write altogether?
def solve() -> int: ella_pictures = 10 * 6 total = ella_pictures + 10 result = total return result
Malik is the reigning champion of his school's chess club for winning the most games each semester. This semester lasts 100 days and Malik won a total of 40 games. His closest opponent won 85% as many games as he did. What was the average number of games per day that the second place winner won?
def solve() -> int: days = 100 malik_wins = 40 second_place_wins = 0.85 * malik_wins avg_wins_per_day = second_place_wins / days result = avg_wins_per_day return result
Student: There are 240 students in a school. If 45% of them are boys, how many boys are there in the school?
def solve() -> int: total_students = 240 percentage_boys = 45 number_boys = total_students * (percentage_boys/100) result = round(number_boys) return result
A recipe for a cake requires 3 cups of flour, 2 cups of sugar, and 4 eggs. How many cakes can Jamie make if he has 12 cups of flour, 10 cups of sugar, and 16 eggs?
def solve() -> int: flour_cakes = 12 // 3 sugar_cakes = 10 // 2 egg_cakes = 16 // 4 min_cakes = min(flour_cakes, sugar_cakes, egg_cakes) result = min_cakes return result
A company offers a salary package of $500 per month plus a 8% commission on sales. If an employee sold $10,000 worth of product in a month, what is their total salary?
def solve() -> int: salary = 500 commission = 0.08 sales = 10000 total_salary = salary + commission * sales result = total_salary return result
A jar with candy has a ratio of 5:8. If there are 104 pieces of candy in the jar, how many pieces are there in the smaller share?
def solve() -> int: total_ratio = 5+8 small_share_ratio = 5/total_ratio small_share = small_share_ratio*104 result = round(small_share) return result
David invests $5000 in a mutual fund that has an average annual return of 8%. He withdraws $200 at the end of each year for 10 years. How much money will he have left in the fund after 10 years?
def solve() -> int: initial_amount = 5000 annual_return = 0.08 annual_withdrawal = 200 number_of_years = 10 future_value = initial_amount * (1 + annual_return) ** number_of_years total_withdrawals = annual_withdrawal * (1 - (1 + annual_return) ** number_of_years) / (1 - (1 + annual_return)) ...
Mrs Lam has 30 cookies to share among her 5 children. Andrew wants twice as much as Bobby and Cassie each wants 3 times as much as Dalton. How many cookies will each child get?
def solve() -> int: Andrew_cookies = 2 * 5 Bobby_cookies = 1 * 5 Cassie_cookies = 3 * 1 Dalton_cookies = 1 * 1 result = int(30/(Andrew_cookies + Bobby_cookies + Cassie_cookies + Dalton_cookies)) return result
John can run at a speed of 6 miles per hour. How long will it take him to run 18 miles?
def solve() -> int: distance = 18 speed = 6 time = distance/speed result = time return result
A school is planning a field trip. The bus rental costs $400 plus $25 per person. If the school has 20 students and 4 teachers, how much would it cost in total to rent a bus for the field trip?
def solve() -> int: bus_rental_base = 400 cost_per_person_bus = 25 num_students = 20 num_teachers = 4 total_people = num_students + num_teachers total_rental_cost = bus_rental_base + cost_per_person_bus*total_people result = total_rental_cost return result
A rectangular box has a length of 5 meters, a width of 6 meters, and a height of 4 meters. Find the volume of the box.
def solve() -> int: length = 5 width = 6 height = 4 volume = length * width * height result = volume return result
A pizza is divided into 10 equal slices. If 5 slices are eaten, what percentage of the pizza is left?
def solve() -> int: total_slices = 10 slices_eaten = 5 slices_left = total_slices - slices_eaten percent_left = slices_left / total_slices * 100 result = percent_left return result
Student: A company pays its employees a base salary of $2000 per month and an additional commission of 5% of total sales. If an employee makes $10,000 in sales in a month, how much will they earn including commission?
def solve() -> int: base_salary = 2000 sales = 10000 commission_rate = 0.05 commission = sales * commission_rate total_salary = base_salary + commission result = total_salary return result
Katie wants to buy markers for her art class. She gives each student 4 markers. She teaches 4 periods a day and each class has 15 students. If a pack of 20 markers costs $3, how much will Katie spend on all the markers?
def solve() -> int: students_per_class = 15 periods_per_day = 4 markers_per_student = 4 markers_per_pack = 20 cost_per_pack = 3 total_students = students_per_class * periods_per_day total_markers = total_students * markers_per_student total_packs = total_markers / markers_per_pack ...
If a pizza has a diameter of 12 inches, what is its area? Use 3.14 for pi.
def solve() -> int: diameter = 12 radius = diameter / 2 pi = 3.14 area = pi * (radius ** 2) result = area return result
A group of friends has a total of $1200. They want to buy tickets to a concert that cost $40 each. If they each buy one ticket and some money is left over, what's the largest possible number of friends in the group?
def solve() -> int: maxFriends = 1200//40 result = maxFriends return result
Mrs. Ramirez has a package of tissues with enough for 15 days. After one-half of the days, she has 9 tissues left. How many tissues is Mrs. Ramirez supposed to use every day if she uses the same amount daily?
def solve() -> int: days = 15 remaining_tissues = 9 used_tissues = (days / 2) - remaining_tissues tissues_per_day = used_tissues / (days / 2) result = tissues_per_day return result
A rectangular-shaped billboard is 12 feet high and 24 feet wide. If each letter of the name of the company on the billboard is 2 feet high and 1.5 feet wide, how many letters can the company put on the billboard?
def solve() -> int: height_of_each_letter = 2 width_of_each_letter = 1.5 height_of_billboard = 12 width_of_billboard = 24 letters_horizontally = width_of_billboard // width_of_each_letter letters_vertically = height_of_billboard // height_of_each_letter total_letters = letters_horizontally *...
A person wants to buy a new car. The sticker price of the car is $34,000, but the dealer is offering a 10% discount. If the person also has to pay sales tax of 5%, how much will the car cost after all discounts?
def solve() -> int: sticker_price = 34000 discount = 0.1 sales_tax = 0.05 discount_amount = sticker_price * discount price_after_discount = sticker_price - discount_amount total_price = price_after_discount * (1 + sales_tax) result = total_price return result
Lily walks her dog every day for 30 minutes from 6:00 am to 6:30 am only on weekdays. If she walks her dog every day except for Monday, how much total time did she spend walking her dog?
def solve() -> int: time_walked = 30 * 4 total_time_walked = time_walked + 30 result = total_time_walked return result
Max has 500 comic books. He decides to sell them and use the money to buy movie tickets. Each comic book sells for $3. A movie ticket costs $12. If he buys 30 movie tickets, how much money does he have left over?
def solve() -> int: comics = 500 comic_price = 3 movie_ticket_price = 12 num_tickets = 30 total_comic_price = comics * comic_price total_ticket_price = num_tickets * movie_ticket_price money_left = total_comic_price - total_ticket_price result = money_left return resul...
A store is having a sale where all items are 20% off. If a shirt normally costs $25, how much does it cost during the sale?
def solve() -> int: price_regular = 25 discount = 0.20 discount_amount = price_regular * discount final_cost = price_regular - discount_amount result = final_cost return result
- Kelly bought 5 yards of ribbon to make bows for her gifts. She used 1/6 of a yard of ribbon for each bow. She made 12 bows and had some ribbon left over. How many yards of ribbon did she have left over?
def solve() -> int: total_ribbon = 5 total_ribbon = total_ribbon * 6 bow_ribbon = 1 bows_ribbon = bow_ribbon * 12 leftover_ribbon = total_ribbon - bows_ribbon leftover_ribbon = leftover_ribbon / 6 result = leftover_ribbon return result
David earns $12 per hour working at a bookstore. He worked for 6 hours on Monday, 5 hours on Tuesday, and 4 hours on Wednesday. How much money did he earn in total?
def solve() -> int: x = 12 * 6 y = 12 * 5 z = 12 * 4 total = x + y + z result = total return result
Flora has 21 coins. If she gives three less than twice the number of coins she has to her friend, how many coins does Flora have now?
def solve() -> int: coins = 21 give = 3 times = 2 remaining_coins = coins - (give - (times * coins)) result = remaining_coins return result
Jacob runs an average of 10 kilometers a day. His friend runs 4 times as much as Jacob does. Because his dad is so tired from his night shift job, for every kilometer Jacob runs, he rests for 2 minutes. How many hours does Jacob's dad rest in a week?
def solve() -> int: jacob_distance = 10 friend_distance = 4 * jacob_distance jacob_rest_time = jacob_distance * 2 friend_rest_time = friend_distance * 2 total_rest_time = jacob_rest_time + friend_rest_time hours_rest = total_rest_time / 60 result = hours_rest * 7 retu...
Student: A recipe calls for 2 1/2 cups of flour to make one loaf of bread. If you want to make three loaves of bread, how many cups of flour do you need?
def solve() -> int: loaves = 3 cups_per_loaf = 2.5 total_cups = loaves * cups_per_loaf result = total_cups return result
A hotel has 50 rooms, and each room requires 3 towels per day. If there is an increase of 10 rooms, how many towels will be required for all rooms for a week (7 days)?
def solve() -> int: rooms = 50 towels_per_room = 3 increase = 10 days = 7 total_rooms = rooms + increase total_towels = total_rooms * towels_per_room * days result = total_towels return result
If Matt watches eight 22-minute episodes and one 40-minute movie, how long does he spend watching videos?
def solve() -> int: episodes = 8 episode_length = 22 movie_length = 40 total_episode_time = episodes * episode_length total_movie_time = movie_length total_time = total_episode_time + total_movie_time result = total_time return result
Owen has 90 beads. He gives away 5/6 of them. How many beads does Owen have left?
def solve() -> int: number_of_beads = 90 fraction = 5/6 remaining_beads = number_of_beads * (1-fraction) result = remaining_beads return result
A data entry clerk can enter 50 records in one hour. If the clerk works for 7 hours every day from Monday to Friday, and for 4 hours on Saturday, how many records does the clerk enter in 2 weeks?
def solve() -> int: records_per_hour = 50 hours_per_weekday = 7 hours_on_saturday = 4 days_per_week = 5 weeks = 2 records_per_weekday = records_per_hour * hours_per_weekday records_on_saturday = records_per_hour * hours_on_saturday records_per_week = records_per_weekday * days_per_w...
If a rectangle has a length of 7cm and an area of 84cm², what is the width of the rectangle?
def solve() -> int: rectangle_area = 84 rectangle_length = 7 rectangle_width = rectangle_area / rectangle_length result = rectangle_width return result
Alex has 12 quarters and 22 pennies. He buys 2 sandwiches for 5 quarters each and 1 pocket-sized notebook for 10 pennies. How much money, in cents, does he have left?
def solve() -> int: quarters = 12 pennies = 22 sandwich_price = 5 * 2 notebook_price = 10 total_spent = sandwich_price + notebook_price money_left = (quarters * 25) + pennies - total_spent result = money_left return result
Possible questions and programs: Mason baked 15 muffins with 5 cups of flour. How many more cups of flour does Mason need to bake a total of 27 muffins?
def solve() -> int: ratio = 15 / 5 flour = 27 / ratio difference = flour - 5 result = difference return result
Gina has 24 toys and wants to give three of them to each of her four siblings. How many toys will each sibling get?
def solve() -> int: total_toys = 24 number_of_siblings = 4 toys_per_sibling = 0 toys_per_sibling = total_toys / number_of_siblings result = toys_per_sibling return result
5. In a race, Ethan had 8 runners competing. If each runner ran 3 laps, how many laps were there in total?
def solve() -> int: total_laps = 0 total_laps = total_laps + (8 * 3) result = total_laps return result
There is a sale at the store and Teresa wants to buy 4 guitars and 3 drums. Each guitar cost $150 and each drum costs $120. How much money will Teresa spend?
def solve() -> int: num_guitars = 4 g_cost = 150 num_drums = 3 d_cost = 120 totalcost = (num_guitars * g_cost) + (num_drums * d_cost) result = totalcost return result