question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
2. Joaquin needs to fill up a pool that is 7m long, 16m wide and 3.5m deep. The pool needs 15cm of water. The density of water is 1000kg/m^3. How much water needs to be added to the pool (in m^3)?
def solve() -> int: length = 7 width = 16 depth = 3.5 water_depth = 0.15 density = 1000 volume = length*width*(depth+water_depth) result = volume return result
There are 30 students in a science class. If the teacher wants to pair them up for a group project, how many pairs can she make?
def solve() -> int: num_students = 30 num_pairs = num_students/2 result = num_pairs return result
A carnival is in town and the admission tickets cost $10 each. A family of four wants to purchase 2 tickets for the rides and 4 admission tickets. If they also want to play a game which costs $5, how much do they still need to spend to complete their budget of $80?
def solve() -> int: ride_ticket_price = 15 admission_ticket_price = 10 num_ride_tickets = 2 num_admission_tickets = 4 game_price = 5 total_cost = num_ride_tickets * ride_ticket_price + num_admission_tickets * admission_ticket_price + game_price remaining_budget = 80 - total_cost ...
Ben is mixing brown, purple and white paint in a 6 : 7 : 9 ratio. If he uses 12 gallons of purple paint, how many gallons of paint does he use total?
def solve() -> int: gallons_of_brown = 12 * 6 / 22 gallons_of_purple = 12 * 7 / 22 gallons_of_white = 12 * 9 / 22 result = gallons_of_brown + gallons_of_purple + gallons_of_white return result
A car travels 220 miles in 4 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance = 220 time = 4 average_speed = distance / time result = average_speed return result
Student: Ali has 12 stickers of cars and 18 stickers of animals. He wants to divide them equally among his 6 friends. How many stickers of each type will each friend get?
def solve() -> int: cars = 12 animals = 18 friends = 6 cars_per_friend = cars // friends animals_per_friend = animals // friends total_per_friend = cars_per_friend + animals_per_friend result = total_per_friend return result
A store has 150 oranges. If the store sells 3 oranges for $1, how much money will they make from selling all their oranges?
def solve() -> int: num_oranges = 150 price = 1/3 total_money = num_oranges * price result = total_money return result
Student: Julie has $150. She wants to spend a third of it on a dress and save the rest. She uses half of the money allocated for the dress to pay for shoes. Finally, she uses $25 of her saved money to buy a purse. How much money did Julie save?
def solve() -> int: money = 150 dress = money / 3 shoes = dress / 2 purse = 25 result = money - dress - shoes - purse return result
A museum has 100 paintings, with 35% of them temporarily on loan to another museum. The remaining paintings are displayed in two equal parts, with one part on exhibit on odd-numbered days and the other part on even-numbered days. What percentage of paintings are on display each day?
def solve() -> int: total_paintings = 100 temporarily_on_loan = total_paintings * 0.35 remaining_paintings = total_paintings - temporarily_on_loan paintings_on_display = remaining_paintings / 2 percentage_on_display = (paintings_on_display / total_paintings) * 100 result = percentage_on_display ...
Student: A tank contains 200 liters of water. If 25% of the water is removed from the tank, how many liters of water are left?
def solve() -> int: tank_capacity = 200 percent_removed = 25 liters_removed = tank_capacity * percent_removed / 100 liters_left = tank_capacity - liters_removed result = liters_left return result
If the area of a square is 25 square meters, what is the length of one side of the square?
def solve() -> int: square_area = 25 side_length = square_area**(1/2) result = side_length return result
Lisa made a pizza and ate 2/7 of it. If the pizza weighed 1500 grams in total, how many grams did Lisa eat?
def solve() -> int: pizza_weight = 1500 ate_fraction = 2/7 ate_weight = pizza_weight * ate_fraction result = ate_weight return result
A swimming pool has a maximum capacity of 25000 gallons of water. On Monday, the pool is filled to 1/3 of its capacity. On Tuesday, it rains 3 inches. If each inch of rain means 400 gallons of water for the pool, to what level, as a fraction, will the pool be filled after the rain?
def solve() -> int: capacity = 25000 filled1 = (1/3)*capacity rain = 3 gallons_per_inch = 400 filled2 = filled1 + (rain*gallons_per_inch) fraction_filled = filled2/capacity result = fraction_filled return result
Mark has a toy that is 50 inches long. He decides to split it equally between his two kids. If he does this 4 times, how many inches of the toy will each of his kids have in total? Mr. Patel is the CEO of a startup with 20 employees, generating a monthly revenue of $800000. The company pays 15% in taxes, 7% of the rema...
def solve() -> int: toy_length = 50 split = 2 total_splits = 4 total_length = toy_length / split total_length *= total_splits result = total_length revenue = 800000 taxes = revenue * 0.15 revenue -= taxes research = revenue * 0.07 revenue -= research operational...
Leo has 6 brown buttons. He has 4 less than brown red and 2 more than red green buttons. How many buttons does Leo have in all?
def solve() -> int: brown = 6 red = brown - 4 green = red + 2 total = brown + red + green result = total return result
A bike tire rotates an average of 3.5 times per second. How many times will it rotate in 10 seconds, to the nearest whole number?
def solve() -> int: rotations_per_second = 3.5 total_seconds = 10 total_rotations = rotations_per_second * total_seconds rounded_rotations = round(total_rotations) result = rounded_rotations return result
Ben has a 5-meter long rope. He wants to cut the rope into equal pieces that are 20 centimeters long. How many pieces of rope will he get? There are 100 centimeters in 1 meter.
def solve() -> int: rope_cm = 5 * 100 pieces = rope_cm / 20 result = pieces return result
John runs for 3 miles every other day for a week. How many miles does he run in total over the course of one week?
def solve() -> int: miles_per_day = 3 days_run_per_week = 7/2 total_miles = miles_per_day * days_run_per_week result = total_miles return result
Baker Joe made blueberry muffins cut into 3 pieces and chocolate muffins cut into 4 pieces for the brunch menu. 63 customers ordered slices of blueberry muffins and 72 customers ordered slices of chocolate muffins. How many total muffins did Baker Joe sell?
def solve() -> int: blueberry_slices = 63 chocolate_slices = 72 blueberry_muffins = blueberry_slices // 3 chocolate_muffins = chocolate_slices // 4 total_muffins = blueberry_muffins + chocolate_muffins result = total_muffins return result
Student: A TV costs $500. If you get a 20% discount for paying in cash, how much would you pay?
def solve() -> int: price = 500 discount = 0.2 discounted_price = price * (1 - discount) result = discounted_price return result
Eva is going to spend 1/6 of a day gardening. She will plant flowers, vegetables, and herbs. She can plant 18 flowers an hour, 12 vegetables an hour, and 15 herbs an hour. If she plants each for 1/3 of her time, how many plants does she plant?
def solve() -> int: total_time = 1/6 flowers_time = 1/3 vegetables_time = 1/3 herbs_time = 1/3 flowers_rate = 18 vegetables_rate = 12 herbs_rate = 15 flowers_plants = flowers_rate * flowers_time * total_time vegetables_plants = vegetables_rate * vegetables_time * total_time herbs...
Q2: Lisa is a gardener. She plants and harvests flowers for her customers. She can plant 8 flowers in one hour and harvest 10 flowers in one hour. She charges $1.50 for each flower she plants and $2.00 for each flower she harvests. She pays $0.75 for each flower seed and $0.50 for each flower pot. How much money does s...
def solve() -> int: time_planting = 40 / 8 time_harvesting = 40 / 10 total_time = time_planting + time_harvesting total_cost = 40 * (0.75 + 0.50) total_income = 40 * (1.50 + 2.00) total_money = total_income - total_cost result = total_money return result
Michelle has $150. She spends a third of it in groceries, a fourth in clothes and donates the rest to charity. How much money does she have left?
def solve() -> int: amount = 150 amount -= amount/3 amount -= amount/4 amount -= amount result = amount return result
A classroom has 32 students. 12 students have brown hair, and 8 students have blonde hair. How many students have a hair color other than brown or blonde?
def solve() -> int: total_students = 32 brown_hair = 12 blonde_hair = 8 other_hair = total_students - (brown_hair + blonde_hair) result = other_hair return result
Peter, John, and Sam had a total of $640. If Peter had twice the amount of money that John had and Sam had $50 less than Peter, how much money did John have?
def solve() -> int: total_money = 640 sam_peter_diff = 50 peter = (total_money - sam_peter_diff) / 3 john = peter / 2 sam = peter - sam_peter_diff result = john return result
Kelly has some tulips in her vase. Every week, the number of tulips decreases by 10% due to wilting. After 5 weeks, Kelly buys 3 more tulips and puts them in the vase. If she now has 12 tulips, how many did she have at the beginning?
def solve() -> int: tulips = 12 tulips = tulips - 3 for i in range(5): tulips = tulips / 0.9 result = tulips return result
Rachel is selling lemonade at a stand. On Monday, she sells 5 cups. On Tuesday she sells twice as many cups as she did on Monday. On Wednesday, she sells 3 more cups than she did on Tuesday. Finally, on Thursday, she sells half the total number of cups she had sold so far. How many cups of lemonade did she sell on Thur...
def solve() -> int: cups_monday = 5 cups_tuesday = cups_monday * 2 cups_wednesday = cups_tuesday + 3 total_cups = cups_monday + cups_tuesday + cups_wednesday cups_thursday = total_cups / 2 result = cups_thursday return result
The sum of two numbers is 50. One of the numbers is 18. What is the other number?
def solve() -> int: sum_of_numbers = 50 first_number = 18 second_number = sum_of_numbers - first_number result = second_number return result
A runner runs at a pace of 6 miles per hour for 5 hours and then increases the speed to 8 miles per hour for the next 2 hours. What is the total distance covered by the runner?
def solve() -> int: speed1 = 6 time1 = 5 speed2 = 8 time2 = 2 distance1 = speed1 * time1 distance2 = speed2 * time2 total_distance = distance1 + distance2 result = total_distance return result
A toy store offers a "Build Your Own Lego Set" deal. A basic set costs $20.00, any kind of accessory is $5.00 extra and each Lego piece costs $0.50. If Max wants a set with two different accessories and 50 pieces of Legos, how much will his set cost?
def solve() -> int: basic_set_cost = 20.00 accessory_cost = 5.00 lego_piece_cost = 0.50 num_accessories = 2 num_lego_pieces = 50 total_cost = basic_set_cost + (accessory_cost * num_accessories) + (lego_piece_cost * num_lego_pieces) result = total_cost return result
Possible new questions and python programs are: Jerome wants to buy a new sofa for his living room. He has a budget of $800, but the sofa he likes costs $960. He decides to buy a cheaper sofa that is 80% of the original price of the sofa he likes, and also get a matching coffee table that is 25% of the price of the che...
def solve() -> int: x = 0.8 * 960 y = 0.25 * x total = x + y result = total return result
Student: Lyn is selling homemade jams. She has 24 jars of strawberry jam, and 12 jars of raspberry jam. If 80% of the total jars are sold, how many jars of jam are left?
def solve() -> int: strawberry_jars = 24 raspberry_jars = 12 total_jars = strawberry_jars + raspberry_jars jars_sold = total_jars * 0.8 jars_left = total_jars - jars_sold result = jars_left return result
Tom went on a shopping spree and bought 3 shirts for $25 each, 2 pairs of pants for $40 each, and a jacket for $80. If the tax rate is 8%, what is the total cost of Tom's items with tax included?
def solve() -> int: shirt_price = 25 shirt_quantity = 3 pants_price = 40 pants_quantity = 2 jacket_price = 80 subtotal = (shirt_quantity * shirt_price) + (pants_price * pants_quantity) + jacket_price tax_rate = 0.08 total = subtotal + (subtotal * tax_rate) result = total return ...
A garden has 46 rows of flowers. Each row has 26 flowers. How many flowers are in the garden in total?
def solve() -> int: num_of_rows = 46 flowers_per_row = 26 total_flowers = num_of_rows * flowers_per_row result = total_flowers return result
At a toy store, there are 43 stuffed animals, 22 toy trucks, and 67 action figures. If Sarah takes away 3 stuffed animals, and Mike takes away 6 toy trucks and four times as many action figures as the number of toy trucks that he removed, then how many toys are left at the store?
def solve() -> int: stuffed_animals = 43 toy_trucks = 22 action_figures = 67 stuffed_animals -= 3 toy_trucks -= 6 action_figures -= 4 * 6 total_toys = stuffed_animals + toy_trucks + action_figures result = total_toys return result
There are 30 students in a classroom. If 20% of them join a festival, how many students join the festival?
def solve() -> int: total_students = 30 percentage_joining = 20 students_joining = total_students * (percentage_joining/100) result = students_joining return result
John has 24 apples. He gave 8 to his sister and 4 to his brother. He ate 5 apples. How many apples does John have left?
def solve() -> int: total_apples = 24 apples_to_sister = 8 apples_to_brother = 4 apples_eaten = 5 apples_left = total_apples - apples_to_sister - apples_to_brother - apples_eaten result = apples_left return result
Alex is building a fence around his yard and needs to know how much fencing he will need. If his yard is rectangular and measures 100 ft by 75 ft, how many feet of fencing should he buy?
def solve() -> int: length = 100 width = 75 perimeter = 2 * (length + width) result = perimeter return result
A customer pays $360 for a new TV after a discount of 20%. What was the original price of the TV?
def solve() -> int: final_price = 360 discount = 0.2 original_price = final_price / (1 - discount) result = original_price return result
Student: In a class of 30 students, there are 15 boys and 15 girls. If each boy has 2 pencils and each girl has 3 pencils, how many total pencils are in the class?
def solve() -> int: boys = 15 girls = 15 total_pencils = boys * 2 + girls * 3 result = total_pencils return result
A person wants to save $1000 in a year. How much should they save per month to reach their goal?
def solve() -> int: goal = 1000 months = 12 savings_per_month = goal / months result = savings_per_month return result
A car drives at a speed of 50 kilometers per hour for 5 hours without stopping. How far does the car travel?
def solve() -> int: speed = 50 time = 5 distance = speed * time result = distance return result
Student: 2. Tony saved $26 in March, $37 in April and $46 in May. He bought a new video game for $84. How much money does he have left?
def solve() -> int: march_saving = 26 april_saving = 37 may_saving = 46 video_game_cost = 84 total_saving = march_saving + april_saving + may_saving remaining_money = total_saving - video_game_cost result = remaining_money return result
Two days ago, the length of a piece of string increased by 1.2 inches every hour. If the string measured 10 inches at 9 AM, what was the length of the string at 1 PM?
def solve() -> int: hours_passed = 4 increase_per_hour = 1.2 initial_length = 10 length_at_1_PM = initial_length + (increase_per_hour * hours_passed) result = length_at_1_PM return result
Student: There are 24 students in a classroom, and each student has 2 pencils. How many pencils are in the classroom in total?
def solve() -> int: num_students = 24 num_pencils_per_student = 2 total_pencils = num_students * num_pencils_per_student result = total_pencils return result
Emily is traveling to visit her grandparents. If she takes the train, it will take her 4 hours to arrive at her destination; but if she drives, it will only take her 2 hours. How much time will Emily save by driving to her grandparents' house and back?
def solve() -> int: train_time = 4 drive_time = 2 total_time_saved = (train_time - drive_time) * 2 result = total_time_saved return result
Here are some possible math questions and their Python programs. (Note: For convenience, I used the variable names from the original question, but you can change them as you like. ) Tom is a baker who makes cakes and pies. On Monday, he made 15 cakes and 10 pies. Each cake costs $12 and each pie costs $8. On Tuesday, h...
def solve() -> int: cakes_monday = 15 pies_monday = 10 cakes_tuesday = cakes_monday * 1.2 pies_tuesday = pies_monday * 0.75 cakes_wednesday = 5 pies_wednesday = 12 cakes_sold = cakes_monday + cakes_tuesday + cakes_wednesday pies_sold = (pies_monday + pies_tuesday) / 2 cake_pric...
Coral Reef has 300 fish. This means there are 30 less than 6 times as many fish on Coral Reef as on Seashore Sands. How many fish are on Seashore Sands?
def solve() -> int: coral_reef_fish = 300 seashore_sands_fish = (coral_reef_fish + 30) / 6 result = seashore_sands_fish return result
A school has a budget of $2500 for new textbooks. If each textbook costs $75, how many textbooks can they purchase?
def solve() -> int: budget = 2500 book_price = 75 num_books = budget / book_price result = num_books return result
A gardener needs to water their plants for 45 minutes every day. If they need to leave the house at 10:00 am and it takes 15 minutes to get ready, what is the latest time the gardener can start watering the plants?
def solve() -> int: start_time = 10 * 60 get_ready_time = 15 watering_time = 45 latest_start_time = start_time - get_ready_time - watering_time result = f'<<<{latest_start_time // 60}:{latest_start_time % 60:02}>>>' return result
There are 2 boxes, each of them contains 10 noodles. The ratio between the length of each noodle in the first box and the one in the second box is 4:3. Find the total sum of the length of all the noodles in both boxes.
def solve() -> int: length1 = 10 * 4 length2 = 10 * 3 lengthtotal = length1 + length2 result = lengthtotal return result
Michael and Laura were running in a marathon. Together they ran 50 miles. Laura ran twice the distance that Michael ran. How many miles did Laura run?
def solve() -> int: michael_distance = 0 laura_distance = 0 michael_distance = 20 laura_distance = 2 * michael_distance result = laura_distance return result
John is going on a trip. He drives to the airport which takes him 45 minutes. He then has to wait for 30 minutes before his flight. The flight takes 2 hours and 15 minutes. If he then takes a taxi which takes him 20 minutes to reach his destination, how long did the entire trip take?
def solve() -> int: distance_to_airport = 30 flight_time = 135 distance_to_destination = 20 total_time = distance_to_airport + flight_time + distance_to_destination result = total_time / 60 return result
Jill and Marie are knitting. Jill can knit 20 stitches per minute while Marie can knit 8 stitches per minute more than her. If Jill has knitted 140 stitches, how many stitches has Marie knitted by then?
def solve() -> int: jill_stitches_per_minute = 20 marie_stitches_per_minute = jill_stitches_per_minute + 8 jill_stitches = 140 marie_stitches = (jill_stitches / jill_stitches_per_minute) * marie_stitches_per_minute result = marie_stitches return result
Lena wants to buy a shirt that is $45, but she only has $30. If she gets paid $10 an hour, how many hours will she need to work to afford the shirt (not including taxes)?
def solve() -> int: price_of_shirt = 45 money_on_hand = 30 hourly_rate = 10 hours_needed = (price_of_shirt - money_on_hand) / hourly_rate result = hours_needed return result
Student: A company produces 450 pencils per hour. If the company operates for 8 hours per day, how many pencils are produced in a week?
def solve() -> int: pencils_per_hour = 450 hours_per_day = 8 days_per_week = 7 pencils_per_day = pencils_per_hour * hours_per_day pencils_per_week = pencils_per_day * days_per_week result = pencils_per_week return result
Julie has 22 cookies and she wants to divide them into equal groups of 3. How many groups of cookies will she be able to make?
def solve() -> int: cookies_per_group = 3 total_groups = 22 / cookies_per_group result = total_groups return result
Student: A store sells a shirt for $25 and a pair of shoes for $60. If Susan buys 2 shirts and a pair of shoes, how much does she spend?
def solve() -> int: shirt_price = 25 shoes_price = 60 num_shirts = 2 total_cost = shirt_price * num_shirts + shoes_price result = total_cost return result
David has to paint 3 walls of his room, each with a different color. The first wall is 10 feet long and 8 feet high, the second wall is 12 feet long and 8 feet high, and the third wall is 15 feet long and 8 feet high. He can paint 10 square feet of wall in one hour with one color. How long will it take David to paint a...
def solve() -> int: first_wall = 10 * 8 second_wall = 12 * 8 third_wall = 15 * 8 first_time = first_wall / 10 second_time = second_wall / 10 third_time = third_wall / 10 total_time = first_time + second_time + third_time result = f'David will take {total_time} hours to pa...
Possible questions and programs: Adam wants to buy a laptop that costs $800. He has $300 in his savings account and can earn $50 per week by doing chores. He also finds a coupon that gives him a 10% discount on the laptop. How many weeks will it take Adam to save enough money to buy the laptop?
def solve() -> int: discounted_price = 800 * 0.9 amount_needed = discounted_price - 300 weeks = amount_needed / 50 weeks = int(weeks) + 1 result = weeks return result
Andrew and Bryan worked out together. Andrew went to the gym for 4 days and worked out for 1.5 hours each day. Bryan went to the gym for 3 days and worked out for 2 hours each day. How many more hours of workout did Andrew have than Bryan?
def solve() -> int: hours_andrew = 4 * 1.5 hours_bryan = 3 * 2 difference = hours_andrew - hours_bryan result = difference return result
Amy is planning a trip to Europe and wants to budget for the hotel. If she stays for 10 nights in a hotel that costs $150 per night, and the hotel charges a 10% tax, how much will the total cost be?
def solve() -> int: pre_tax = 150*10 tax = pre_tax * 0.1 total_cost = pre_tax + tax result = total_cost return result
What is 92.5% of 350?
def solve() -> int: number = float(350) percentage = float(0.925) result = number * percentage result = 324.375 return result
If you multiply Brody's age by 4 and then subtract 2, it is the same as 3 times smaller than Max's age. If Brody is 18 years old, how old is Max?
def solve() -> int: brody_age = 18 max_age = (brody_age * 4 + 2) / 3 result = max_age return result
In a flower shop, for every 9 rose bouquets sold, 12 daisy bouquets are sold. If the shop sold 45 rose bouquets, how many bouquets were sold altogether?
def solve() -> int: roses_sold = 45 daisies_sold = (12/9) * roses_sold total_bouquets = roses_sold + daisies_sold result = total_bouquets return result
A bag contains 10 red balls and 14 blue balls. If one ball is randomly selected, what is the probability it will be red?
def solve() -> int: num_red_balls = 10 num_blue_balls = 14 total_balls = num_red_balls + num_blue_balls prob_red = num_red_balls / total_balls result = prob_red return result
James spends 15 minutes making coffee each morning. He spends 35 minutes cooking lunch and 25 minutes preparing dinner every day. On Saturday and Sunday he spends 45 minutes preparing dinner. How many minutes does James spend preparing food this week?
def solve() -> int: coffee_time = 15 lunch_time = 35 weekday_dinner_time = 25 weekend_dinner_time = 45 weekday_prep_time = lunch_time + weekday_dinner_time weekend_prep_time = weekend_dinner_time * 2 total_weekday_prep_time = weekday_prep_time * 5 total_weekend_prep_time = week...
For her birthday, Olivia received clothes and money. Her sister gave her $35, her mom gave her $20, and her aunt gave her $15. With what she already had, she now has $105 in her bank account. She goes to a jewelry store and gets 2 necklaces that cost $40 each. How much does she have left after this purchase?
def solve() -> int: olivia_money = 35 + 20 + 15 total_money = olivia_money + 105 necklace_cost = 40 * 2 remaining_money = total_money - necklace_cost result = remaining_money return result
Carlos and Dora both like collecting coins and magnets. Dora and Carlos decide to trade some coins and magnets. They have each decided that one magnet is worth 3 coins. Each coin roll contains 50 coins. If Carlos arrives with 5 magnets, Dora has 6 coin rolls, and Dora trades all her coin rolls for magnets, how many mag...
def solve() -> int: magnet_value = 3 coin_roll_size = 50 carlos_magnets = 5 dora_coin_rolls = 6 dora_coins = dora_coin_rolls * coin_roll_size dora_magnets = dora_coins // magnet_value dora_coins_left = dora_coins % magnet_value carlos_magnets += dora_magne...
An employee earns $40 per hour for the first 8 hours of work, and $60 per hour for each hour worked after 8 hours. If the employee worked for 12 hours, how much did he earn?
def solve() -> int: hourly_rate_first_8_hours = 40 hourly_rate_after_8_hours = 60 total_hours_worked = 12 if total_hours_worked > 8: overtime_hours = total_hours_worked - 8 regular_hours_pay = 8 * hourly_rate_first_8_hours overtime_pay = overtime_hours * hourly_rate_after_8_hours...
The perimeter of a square is 60. What is the length of one side of the square?
def solve() -> int: side_length = 60/4 result = side_length return result
Anna bought 68 packs of crayons for a school event. She gave away 22 packs of crayons. How many packs of crayons does Anna still have?
def solve() -> int: packs_of_crayons_bought = 68 packs_of_crayons_given_away = 22 result = packs_of_crayons_bought - packs_of_crayons_given_away result = 46 return result
A student's score in a test is 78 out of 100. What is the percentage score?
def solve() -> int: score = 78 total_score = 100 percentage_score = (score/total_score) * 100 result = percentage_score return result
Jenna makes 12 bracelets and sells them for $8 each. She spends $3 on the materials for each bracelet. How much profit does she make from selling the bracelets?
def solve() -> int: revenue = 12 * 8 cost = 12 * 3 profit = revenue - cost result = profit return result
Student: Bethany takes 10 minutes to walk to the store and she takes 15 minutes to buy some groceries from the store. How long did her entire trip take?
def solve() -> int: time_to_store = 10 time_to_buy_groceries = 15 total_time = time_to_store + time_to_buy_groceries result = total_time return result
Emma's lemonade stand sells lemonade, limeade, and orange juice. Emma found out that she made $90 in one day of sales. She made $10 from lemonade and the sales of limeade are twice as much as the sales of lemonade. Then, sales for orange juice is $5 more than half of the sales of limeade. How much did Emma make from se...
def solve() -> int: lemonade_sales = 10 limeade_sales = 2 * lemonade_sales orange_juice_sales = (limeade_sales / 2 + 5) total_sales = lemonade_sales + limeade_sales + orange_juice_sales result = orange_juice_sales return result
A recipe calls for 3/4 cup of sugar, but you only want to make 1/3 of the recipe. How much sugar do you need?
def solve() -> int: recipe_sugar = 0.75 recipe_ratio = 1/3 needed_sugar = recipe_sugar * recipe_ratio result = needed_sugar return result
Tom orders a 12-ounce coffee every morning on his way to work. He drinks half of it while commuting. After he gets to work, he drinks another one-third of the coffee. How many ounces remain in his cup?
def solve() -> int: coffee_ounces = 12 commuting_drink = coffee_ounces / 2 work_drink = commuting_drink / 3 remaining_ounces = coffee_ounces - commuting_drink - work_drink result = remaining_ounces return result
A group of three coworkers share the cost of a coffee machine for the office. The machine costs $160, but they have $80 from a fundraising event. If one of the coworkers doesn't want to participate in the purchase, how much more will the other two coworkers have to pay?
def solve() -> int: machine_cost = 160 fundraising_amount = 80 remaining_cost = machine_cost - fundraising_amount each_coworker_cost = remaining_cost / 2 result = each_coworker_cost return result
Grace bought 4 bags of candies. Each bag has 16 candies. She gave 10 candies to her friend Hannah. How many candies does Grace have left?
def solve() -> int: bags = 4 candies_per_bag = 16 candies_given = 10 result = bags * candies_per_bag - candies_given return result
A waiter received a tip of $12 and kept $25 of the total earnings from his shift. If he made $77 in total from the shift, what was his earnings before tips?
def solve() -> int: tip = 12 kept = 25 total = 77 earnings = total - tip - kept result = earnings return result
A runner wants to run 8 miles. She runs at a pace of 8 minutes per mile. How long will it take her to run 8 miles?
def solve() -> int: distance = 8 pace = 8 time = distance * pace result = time return result
Sara buys a 14-ounce smoothie every morning at the fruit stand. She drinks one-half of the smoothie on the way to work. When she gets to work, she drinks another one-third of the smoothie. She forgets to drink any more of her smoothie once she starts working, and when she remembers her smoothie, she only drinks 2 ounce...
def solve() -> int: smoothie_size = 14 half_smoothie = smoothie_size / 2 remaining_smoothie = smoothie_size - half_smoothie one_third_smoothie = remaining_smoothie / 3 remaining_smoothie -= one_third_smoothie remaining_smoothie -= 2 result = remaining_smoothie return result
A book series had 7 books in 2010. By 2015, the series had grown to 15 books. On average, how many books were added each year? A baker has four ovens to bake his bread. Each oven can bake six loaves of bread at a time. How many loaves of bread can the baker bake in total?
def solve() -> int: books_2010 = 7 books_2015 = 15 years = 2015 - 2010 books_added = books_2015 - books_2010 average_books_added_per_year = books_added / years ovens = 4 loaves_per_oven = 6 total_loaves = ovens * loaves_per_oven result = average_books_added_per_year, t...
Student: The population of Happy Valley is six times as many as the population of Sunnydale. The population of Happy Valley is 900 more than the population of Pleasantville. If Sunnydale has a population of 400, how many people live in Happy Valley and Pleasantville combined?
def solve() -> int: sunnydale_population = 400 happy_valley_population = sunnydale_population * 6 pleasantville_population = happy_valley_population - 900 combined_population = happy_valley_population + pleasantville_population result = combined_population return result
A bakery sells 300 pastries for $2.50 each. How much revenue does the bakery generate in a week?
def solve() -> int: pastries_sold = 300 price_per_pastry = 2.50 revenue = pastries_sold * price_per_pastry result = revenue return result
Possible questions and programs are: Every hour, Leila downloads 5 songs from an online music platform to her computer. If Leila has 120 songs on her computer now, how many songs will she have on her computer at the end of February?
def solve() -> int: hours = 28 * 24 songs = 5 * hours result = 120 + songs return result
John studies for 5 hours every day. It takes him 30 minutes to finish a lesson. How many lessons does he finish in a week (7 days)?
def solve() -> int: hours_per_day = 5 minutes_per_lesson = 30 lessons_per_day = 60*(hours_per_day)/minutes_per_lesson lessons_per_week = lessons_per_day*7 result = lessons_per_week return result
If the circumference of a circle is 6.28, what is the area of the circle?
def solve() -> int: radius = 6.28 / (2 * 3.14) area = radius ** 2 * 3.14 result = area return result
A car is driving at a speed of 40 mph. If the driver stops for 30 minutes halfway through the trip, how long will it take to travel a total distance of 240 miles?
def solve() -> int: total_distance = 240 speed = 40 halfway_distance = total_distance / 2 travel_time_halfway = halfway_distance / speed total_travel_time = travel_time_halfway + 0.5 result = total_travel_time return result
Jessica wants to hire a roofer to fix her leaking roof. The roofer charges $120 for the initial inspection and $500 per day for labor. If it takes the roofer 2 days to fix the roof, what is the total cost?
def solve() -> int: inspection_fee = 120 labor_fee = 500 days_labor = 2 total_labor = labor_fee * days_labor total_cost = inspection_fee + total_labor result = total_cost return result
Daniel has 9 times as many coins as Dana. If Dana has 3 coins, how many coins will they have if they deposit half of their coins in a bank account and keep the other half?
def solve() -> int: Daniel = 9 * 3 Dana = 3 Daniel_after = Daniel / 2 Dana_after = Dana / 2 total = Daniel_after + Dana_after result = total return result
Student: Susana has 14 books. If she gave away 4 of them, how many books does she have left?
def solve() -> int: books = 14 given_away = 4 left = books - given_away result = left return result
Student: Bill has 3 times as much money as Kelly. If Kelly gives 15 dollars to Bill, they will have the same amount of money. How much money does Bill have currently?
def solve() -> int: bill = 0 kelly = 0 bill = kelly + 15 kelly = bill / 3 bill = kelly + 15 result = bill return result
Monica eats a plate of 5 slices of pizza, each having 200 calories. Later, she devours 10 chicken wings that are 20% more calorie-dense than pizza. What's the total amount of calories she ate?
def solve() -> int: pizza_slices = 5 pizza_calories = 200 chicken_wings = 10 calorie_density = 1.2 total_pizza_calories = pizza_slices * pizza_calories total_chicken_wing_calories = chicken_wings * (pizza_calories * calorie_density) total_calories = total_pizza_calories + total_chi...
James plans to travel to Europe and needs to exchange 500 US dollars to euros. The exchange rate is 1 USD to 0.91 euros. How many euros will James receive?
def solve() -> int: usd_amount = 500 exchange_rate = 0.91 euro_amount = usd_amount * exchange_rate result = euro_amount return result
Leo has 20 apples and Mia has 12. They want to share their apples equally with their 4 friends. How many apples will each person get?
def solve() -> int: total_apples = 20 + 12 total_people = 1 + 1 + 4 result = total_apples / total_people return result
Student: Aisha is a graphic designer and works on different projects for different clients. She charges $30 per hour for logo design, $40 per hour for brochure design, and $50 per hour for website design. She also gets a 10% bonus for projects that are completed within a week. Last week, she worked on three projects: a...
def solve() -> int: logo_hours = 6 logo_rate = 30 brochure_hours = 8 brochure_rate = 40 website_hours = 10 website_rate = 50 bonus_percentage = 0.1 logo_earnings = logo_hours * logo_rate brochure_earnings = brochure_hours * brochure_rate website_earnings = website_hours * website...
A recipe calls for 1/4 cup of sugar and makes 12 cookies. How much sugar is needed to make 24 cookies?
def solve() -> int: sugar_per_cookie = 1/4 cookies1 = 12 cookies2 = 24 total_sugar = (cookies2/cookies1) * sugar_per_cookie result = total_sugar return result
----------------- Jack runs 5 km every day. He runs 8% faster on Monday than on Sunday. If he runs for the same amount of time on both days, how many kilometers does he run on Monday?
def solve() -> int: sunday_speed = 5 / 60 monday_speed = sunday_speed * 1.08 monday_distance = monday_speed * 60 result = monday_distance return result