question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jack and Jill went up the hill to fetch a pail of water. The pail could hold 10 liters of water, but they only filled it to 80% of its capacity. On their way down the hill, they spilled a quarter of the water in the pail. How much water did they have left in the pail?
def solve() -> int: capacity = 10 water = capacity * 0.8 water *= 0.75 result = water return result
A rectangular box is given with length 3cm, width 4cm, and height 5cm. Find the volume of this box in cubic centimeters.
def solve() -> int: length = 3 width = 4 height = 5 volume = length * width * height result = volume return result
A pool can hold 2000 liters of water. It is already filled with 1200 liters. The remaining space in the pool is equally divided into 3 tanks such that the first tank has double the capacity of the second and the third combined. The second and third tanks have the same capacity. How many liters of water can the first ta...
def solve() -> int: remaining_volume = 2000 - 1200 volume_tank23 = remaining_volume / 3 volume_tank1 = volume_tank23 * 2 result = volume_tank1 return result
Sarah has three times as much money as Jack. Together, they have $70 more than Rachel. If Jack has $50, how much money do they have altogether?
def solve() -> int: jack_money = 50 sarah_money = 3 * jack_money rachel_money = (jack_money + sarah_money) - 70 total_money = jack_money + sarah_money + rachel_money result = total_money return result
A store offers a 10% discount on items. If a shirt costs $25, what is the discounted price?
def solve() -> int: shirt_price = 25 discount = 0.1 discounted_price = shirt_price - (shirt_price * discount) result = discounted_price return result
The difference between the degrees of two angles of a triangle is 25 degrees and the value of one angle is 60 degrees. What is the value of the third angle in degrees?
def solve() -> int: given_angle = 60 diff_between_angles = 25 third_angle = (180 - (2 * given_angle) - diff_between_angles) / 2 result = third_angle return result
``` Between 7 a.m and 3 p.m, each hour 50 people entered a museum. How many people entered the museum in total between 7 a.m and 3 p.m?
def solve() -> int: people_per_hour = 50 total_hours = 3 - 7 total_people = people_per_hour * total_hours result = total_people return result
Jason has $150 for buying toys. He buys two maths toys at $20 each, three science toys at $15 each and four art toys at $10 each. How much money did he save from buying art toys?
def solve() -> int: math_toys = 2 math_cost = 20 science_toys = 3 science_cost = 15 art_toys = 4 art_cost = 10 total_cost = math_toys * math_cost + science_toys * science_cost + art_toys * art_cost total_cost_art = art_toys * art_cost total_saved = total_cost_art result = total_...
A chef makes a pot of soup that contains 6 cups of water. If she wants to reduce the amount of soup to half, how many cups of soup should she remove?
def solve() -> int: original_amount = 6 new_amount = 6 / 2 amount_to_remove = original_amount - new_amount result = amount_to_remove return result
am has 25 stickers in his album. He buys a pack of 10 stickers and then trades five stickers with his friend Tom. Tom gives him three stickers that he already has and two stickers that he doesn't have. How many stickers does Sam have in his album now, and how many of them are duplicates?
def solve() -> int: stickers = 25 duplicates = 0 stickers = stickers + 10 stickers = stickers - 5 stickers = stickers + 5 duplicates = duplicates + 3 result = (stickers, duplicates) return result
Sara has 6 times as many flowers as Tina, and Tina has 5 times as many flowers as Uma. If Uma has 18 flowers, how many flowers does Sara have?
def solve() -> int: uma = 18 tina = 5 * uma sara = 6 * tina result = sara return result
A laptop initially costs $1250. If the price decreases by 8% every year, what is the worth of the laptop after two years?
def solve() -> int: initial_price = 1250 discount_percentage = 8 price_year_1 = initial_price - (discount_percentage/100)*initial_price price_year_2 = price_year_1 - (discount_percentage/100)*price_year_1 result = price_year_2 return result
The Williams family is going to a concert. They need to buy tickets for themselves, their twoSamantha wants to jog 8 miles. Her stride is 0.5 miles long. How many strides does she need to complete the jog?
def solve() -> int: stride_length = 0.5 total_distance = 8 strides_needed = total_distance / stride_length result = strides_needed return result
Student: Emma earns $2000 per month. She spends 20% of her salary on rent, and 40% of the remaining on food expenses. How much money does she spend on food?
def solve() -> int: salary = 2000 rent = salary * 0.2 food = (salary - rent) * 0.4 result = food return result
A store sells shirts for $25 each. If someone buys 8 shirts, how much money will they spend?
def solve() -> int: price_per_shirt = 25 num_shirts = 8 total_cost = price_per_shirt * num_shirts result = total_cost return result
Marty and Rudy bought 24 boxes of chocolates for $42, and 20 boxes of granola bars for $25. How much did they spend in total?
def solve() -> int: total_spend = 0 total_spend += 42*24 total_spend += 25*20 result = total_spend return result
Samantha works at a museum and needs to keep the exhibits at a particular temperature. Unfortunately, the heating system broke down and the temperature decreased by 7 degrees per hour for six hours. If the heating system is fixed and can increase the temperature at a rate of 4 degrees F per hour, how long will it take ...
def solve() -> int: initial_temp = 68 decrease_rate = 7 decrease_time = 6 decrease_amount = decrease_rate * decrease_time current_temp = initial_temp - decrease_amount increase_rate = 4 time_to_increase = (initial_temp - current_temp) / increase_rate result = time_to_increase re...
In a bakery, there are pies and muffins. Each pie has 8 slices and each muffin has 1 slice. There are 15 pies in the bakery. Altogether all baked goods have 143 slices. How many muffins are in the bakery?
def solve() -> int: pie_slices = 8 muffin_slices = 1 pies = 15 total_slices = 143 muffin_slices = total_slices - pie_slices * pies muffins = muffin_slices // muffin_slices result = muffins return result
Amy ran 10 kilometers in 70 minutes. At this pace, how many kilometers could she run in 110 minutes?
def solve() -> int: pace = 10 / 70 distance = pace * 110 result = str(round(distance, 2)) return result
Student: Mary has 10 coins in her pocket. Four of them are dimes and the rest are quarters. How much money does Mary have in total?
def solve() -> int: num_dimes = 4 num_quarters = 10 - num_dimes total_amount = num_dimes * 0.1 + num_quarters * 0.25 result = total_amount return result
A car rental company has 50 cars. 30% of them are sedans, and 50% of the rest are SUVs. If the number of SUVs is 6 more than the number of sedans, how many SUVs are there?
def solve() -> int: num_sedans = 0 num_suvs = 0 total_cars = 50 num_sedans = 0.3 * total_cars num_suvs = (total_cars - num_sedans) * 0.5 + 6 result = int(num_suvs) return result
Dana's TD3 algorithm obtained 50% of the possible reward on the BossFight environment. BossFight's maximum reward is 30 points more than the average of the maximum rewards of CoinRun and StarPilot. How much reward did Dana's TD3 algorithm get?
def solve() -> int: max_coinrun = 10 * 10 max_starpilot = 10 * 20 avg_coinrun_starpilot = (max_coinrun + max_starpilot) / 2 max_bossfight = avg_coinrun_starpilot + 30 dana_reward = max_bossfight * 0.5 result = dana_reward return result
Peter bought 8 times as many balloons as Nick did. Nick bought half the number of balloons as Sally did. If Sally spent $60 on $3 balloons, how many balloons did Peter and Nick buy altogether?
def solve() -> int: sally_balloons = 3 sally_cost = 60 nick_balloons = sally_balloons / 2 peter_balloons = 8 * nick_balloons total_balloons = nick_balloons + peter_balloons result = total_balloons return result
-Example Solution:(for the current example question) Possible questions and programs are: A watermelon costs $6 in a supermarket. If a fruit stall sells it for 25% more, how much more does Ann have to pay if she buys 4 watermelons from the fruit stall instead of the supermarket?
def solve() -> int: fruit_stall_price = 6 * (1 + 0.25) fruit_stall_cost = fruit_stall_price * 4 supermarket_cost = 6 * 4 difference = fruit_stall_cost - supermarket_cost result = difference return result
``` The ratio of girls to boys in a classroom is 4:5. If there are 63 boys in the classroom, how many students are there?
def solve() -> int: total_ratio = 4 + 5 one_part = 63 / 5 total_students = one_part * total_ratio result = total_students return result
The ratio of boys to girls in a class is 3:5. If there are 24 girls in the class, how many boys are there?
def solve() -> int: girls_count = 24 total_ratio = 3 + 5 boys_ratio = 3 / total_ratio boys_count = girls_count / boys_ratio - girls_count result = boys_count return result
David has 12 friends and he has 4 times the number of teachers as he has friends. He also has his 5 siblings and 6 classmates on his contact list. How many people are on David's contact list?
def solve() -> int: numFriends = 12 numTeachers = numFriends * 4 numSiblings = 5 numClassmates = 6 result = numFriends + numTeachers + numSiblings + numClassmates print (result) return result
Ava collected 15 shells. Jack collected 10 more shells than Ava, and half as many as Leo. If they used 3 shells to make each necklace and sold each necklace for $5, how much money did they make?
def solve() -> int: ava_shells = 15 jack_shells = ava_shells + 10 leo_shells = 2 * jack_shells total_shells = ava_shells + jack_shells + leo_shells necklaces = total_shells // 3 money = necklaces * 5 result = money return result
Mia baked 18 cookies and divided them equally among 6 friends. Each friend ate 2 cookies and gave the rest to Mia. How many cookies did Mia have in the end?
def solve() -> int: cookies_per_friend = 18 / 6 cookies_eaten_per_friend = 2 cookies_left_per_friend = cookies_per_friend - cookies_eaten_per_friend cookies_mia_received = cookies_left_per_friend * 6 result = cookies_mia_received return result
Student: A recipe calls for 2/3 cup of flour to make 12 muffins. How many cups of flour would be needed to make 30 muffins?
def solve() -> int: muffins_needed = 30 muffins_in_recipe = 12 flour_in_recipe = 2/3 flour_needed = (muffins_needed/muffins_in_recipe) * flour_in_recipe result = flour_needed return result
Sarah owes her friend Amanda $120 and paid her back 25% of the debt last month. Today, she borrowed $50 more from Amanda. What is Sarah's total debt now?
def solve() -> int: debt = 120 paid_last_month = debt * 0.25 debt -= paid_last_month debt += 50 result = debt return result
Aidan is planning a road trip and needs to calculate how much gas he'll need. His car gets 30 miles per gallon and the drive is 600 miles roundtrip. How many gallons of gas will he need?
def solve() -> int: miles_per_gallon = 30 drive_distance = 600 gallons_needed = drive_distance / miles_per_gallon result = gallons_needed return result
Janice has 21 markers. She gives half her markers to her cousin. Her cousin then spends 3 markers on art supplies. If Janice has 10 markers left, how many markers did her cousin have at first?
def solve() -> int: result = 8 markers_janice = 21 markers_cousin = markers_janice / 2 markers_cousin = markers_cousin - 3 markers_janice = markers_janice - markers_cousin result = markers_cousin return result
Sarah walks to her friend's house. During the first half of her walk, she walks at a speed of 3 miles per hour. During the second half of her walk, she walks at a speed of 5 miles per hour. If each half of her walk takes 15 minutes, how far is her friend's house from Sarah's home in miles?
def solve() -> int: speed1 = 3 speed2 = 5 time = 0.25 distance1 = speed1 * time distance2 = speed2 * time total_distance = distance1 + distance2 result = total_distance return result
A store owner stocks 100 items. In a day, 45 items were sold. Later, the owner bought 25 more items. How many items does the store owner now have in stock?
def solve() -> int: items_in_stock = 100 items_sold = 45 items_bought = 25 items_left = items_in_stock - items_sold total_items = items_left + items_bought result = total_items return result
Pam is knitting a scarf. She usually drops stitches 6 times for every 60 stitches and can knit roughly 50 stitches per minute. If she knits for 25 minutes, how many times will she drop a stitch on average?
def solve() -> int: stitches_per_minute = 50 minutes = 25 total_stitches = stitches_per_minute * minutes drops_per_stitches = 6 / 60 drops = total_stitches * drops_per_stitches result = drops return result
Emily, the fashion retailer, showcased 30 dresses, 18 blouses, and 13 skirts on the top rack of the store. Half the clothing on the bottom rack were pants, which she re-categorized. Afterwards, she placed the other clothing from the bottom rack, including 4 jackets and 5 scarves. How many pieces of clothing were there ...
def solve() -> int: top_rack_dresses = 30 top_rack_blouses = 18 top_rack_skirts = 13 bottom_rack_pants = 0.5 * (top_rack_dresses + top_rack_blouses + top_rack_skirts) bottom_rack_jackets = 4 bottom_rack_scarves = 5 total_clothing_initial = top_rack_dresses + top_rack_blouses + top_...
ome possible new questions and programs are: - Penelope bought 50 apples from the market and shared them equally with her four friends. The next day, she bought twice as many apples as before and gave half of them to a local charity. On the third day, she bought 100 more apples and ate 10 of them. How many apples did P...
def solve() -> int: apples = 0 apples = apples + 50 apples = apples - 50 / 5 apples = apples + 2 * 50 apples = apples - 0.5 * (2 * 50) apples = apples + 100 apples = apples - 10 result = apples return result
A store offers a 20% discount on all items. If the original price of a shirt is $50, what is the discounted price?
def solve() -> int: original_price = 50 discount_percent = 20 discount_amount = (discount_percent/100) * original_price discounted_price = original_price - discount_amount result = discounted_price return result
Jason bought 36 packs of gum. He chews two packs per day. How many days will the gum last?
def solve() -> int: packs_of_gum = 36 packs_per_day = 2 days = packs_of_gum / packs_per_day result = days return result
If Lucas needs to travel 287 miles and his car does 35 miles per gallon, how many gallons of gas does Lucas need?
def solve() -> int: miles = 287 gallons_per_mile = 35 gallons = miles / gallons_per_mile result = gallons return result
Michael has twelve cookies. Every day, the number of cookies halves. On the fourth day, he eats two cookies. On the sixth day, he bakes six more cookies. How many cookies does he have in total?
def solve() -> int: cookies = 12 day_four = cookies / 2 / 2 / 2 - 2 day_six = (cookies / 2 / 2 / 2 / 2 / 2 + 6) total_cookies = cookies + day_four + day_six result = total_cookies return result
A garden has 200 flowers. 25% of them are tulips, 40% are roses, and the rest are daisies. How many flowers are daisies?
def solve() -> int: total_flowers = 200 tulips = total_flowers * 0.25 roses = total_flowers * 0.4 daisies = total_flowers - tulips - roses result = daisies return result
``` A room is 16 feet wide and 20 feet long with a ceiling height of 8 feet. What is the volume of the room?
def solve() -> int: room_width = 16 room_length = 20 ceiling_height = 8 room_volume = room_width * room_length * ceiling_height result = room_volume return result
Tom and Amy shared a pizza. The pizza had 12 slices, and each slice had 200 calories. Tom ate 3 slices, and Amy ate 4 slices. They also drank some soda, which had 150 calories per can. Tom drank 2 cans, and Amy drank 1 can. How many more calories did Tom consume than Amy?
def solve() -> int: calories_pizza = 200 calories_soda = 150 slices_tom = 3 slices_amy = 4 cans_tom = 2 cans_amy = 1 total_calories_tom = slices_tom * calories_pizza + cans_tom * calories_soda total_calories_amy = slices_amy * calories_pizza + cans_amy * calories_soda ...
Sophia has 80 beads in her jewelry box. She received a necklace containing 35 more beads. Her sister gave her 3/4 of the amount she already had. She decided to give her friend Olivia 2/5 of her total amount of beads. How many beads does she give to Olivia?
def solve() -> int: beads_in_box = 80 beads_in_necklace = 35 total_beads = beads_in_box + beads_in_necklace beads_from_sister = 3/4 * beads_in_box beads_left = total_beads + beads_from_sister beads_given_to_olivia = 2/5 * beads_left result = beads_given_to_olivia return result
A pizza with a 12 inch diameter costs $10. What is the cost per square inch?
def solve() -> int: diameter_inches = 12 radius_inches = diameter_inches / 2 area = 3.14 * radius_inches**2 price = 10 cost_per_square_inch = price / area result = cost_per_square_inch return result
A soccer club sells two types of jerseys, home and away. A home jersey costs $40 and an away jersey costs $35. The club also offers a 25% discount for buying more than one jersey of the same type. How much does a fan pay for buying one home jersey and two away jerseys?
def solve() -> int: home_jersey_price = 40 away_jerseys_price = 2 * 35 * (1 - 0.25) total_price = home_jersey_price + away_jerseys_price result = total_price return result
Martin had 4/7 of a pizza and shared it with his two friends. Calculate how much pizza each of his friends received.
def solve() -> int: total_pizza = 7 * 0.4 pizza_per_friend = total_pizza / 2 result = pizza_per_friend return result
David has a collection of seashells. On Monday, he had 30 seashells. On Tuesday, he lost 15 seashells and his aunt gave him 8 more. On Wednesday, all of David's old and new seashells were missing, so his grandparents bought him 20 new ones. If David found all the lost seashells, including the new ones, how many seashel...
def solve() -> int: monday_seashells = 30 tuesday_seashells = monday_seashells - 15 + 8 wednesday_seashells = tuesday_seashells + 20 result = wednesday_seashells return result
Riley has a bag of 50 marbles. If she gives 25% of the marbles to her friend, how many marbles is she left with? If she finds 10 more marbles from another bag, how many marbles does she have now?
def solve() -> int: marbles = 50 friend_marbles = marbles * 0.25 remaining_marbles = marbles - friend_marbles new_marbles = 10 total_marbles = remaining_marbles + new_marbles result = total_marbles return result
Student: A company produces 2500 laptops per month. If the company earns a profit of $200 on each laptop and has monthly expenses of $1,000,000, what is the company's monthly profit?
def solve() -> int: laptops_per_month = 2500 profit_per_laptop = 200 monthly_expenses = 1000000 monthly_profit = laptops_per_month * profit_per_laptop - monthly_expenses result = monthly_profit return result
Rachel pays $40/hour for 2 hours per week of boxing lessons and $25/hour for 3 hours a week of yoga lessons. How much does she spend on both lessons in a year?
def solve() -> int: hourly_rate_boxing = 40 hourly_rate_yoga = 25 hour_per_week_boxing = 2 hour_per_week_yoga = 3 weeks_per_year = 52 total_spent_boxing = hourly_rate_boxing * hour_per_week_boxing * weeks_per_year total_spent_yoga = hourly_rate_yoga * hour_per_week_yoga * weeks_per_year ...
Joshua has $18 and each of his four teammates has $3. How much will Joshua have to give to each of his teammates so that they all have the same amount of money?
def solve() -> int: joshua_money = 18 teammate_money = 3 total_money = joshua_money + (teammate_money * 4) equal_money = total_money // 5 joshua_give = joshua_money - equal_money teammate_receive = equal_money - teammate_money result = teammate_receive return result
A farmer has 8 fewer goats than chickens, and 4 more ducks than goats. If the farmer has 42 animals total, how many ducks does he have?
def solve() -> int: goats = 0 chickens = 0 ducks = 0 total_no_of_animals = 42 while goats + chickens + ducks*4!= total_no_of_animals: chickens += 1 goats = chickens - 8 ducks = goats + 4 result = ducks return result
A coffee shop sold 85 cups of coffee in one hour. If it sold cups of coffee at a constant rate, how many cups would it sell in 4 hours?
def solve() -> int: cups = 85 time = 4 rate = cups/time cups_4hours = rate*4 result = cups_4hours return result
Student: An airline sold 1000 tickets for a flight for $200 each. If they sold another 500 tickets for 20% less than the original price, calculate the total revenue made from ticket sales.
def solve() -> int: original_tickets = 1000 original_price = 200 extra_tickets = 500 discount_rate = 0.2 extra_price = original_price * (1 - discount_rate) original_revenue = original_tickets * original_price extra_revenue = extra_tickets * extra_price total_revenue = original_rev...
Mr. Patel is buying shoes. He bought 1 pair of shoes for $80 and 2 pairs of shoes for $60 each. How much did he spend on shoes?
def solve() -> int: cost_first_shoe = 80 cost_second_shoe = 60 total_cost_shoes = cost_first_shoe + (2*cost_second_shoe) result = total_cost_shoes return result
Sarah is training for a race and wants to run 20 miles per week. If she runs 5 miles per day, how many days a week should she run?
def solve() -> int: miles_per_week = 20 miles_per_day = 5 days_per_week = miles_per_week // miles_per_day if miles_per_week % miles_per_day!= 0: days_per_week += 1 result = days_per_week return result
There are 15 books on a shelf. Each book has 32 pages. Cindy wants to read all the books on the shelf. She can read 2 pages per minute. How many minutes will it take her to read all the books?
def solve() -> int: books = 15 pages_per_book = 32 pages_per_minute = 2 minutes = (books * pages_per_book) / pages_per_minute result = minutes return result
In a school, 70% of the students take math class and 60% of the students take science class. If there are 500 students in the school, how many students take both math and science classes?
def solve() -> int: num_students = 500 math_percent = 70 science_percent = 60 math_only = num_students * math_percent / 100 science_only = num_students * science_percent / 100 both_classes = math_only + science_only - num_students result = both_classes return result
Sunflower Village has 90 roses. This means there are 30 less than twice as many roses in Sunflower Village as in Lily Village. How many roses are in Lily Village?
def solve() -> int: r = (90 + 30) / 2 result = r return result
The temperature decreased from 18°C to 10°C overnight. What was the percentage decrease in temperature?
def solve() -> int: initial_temp = 18 final_temp = 10 temp_diff = initial_temp - final_temp percent_decrease = (temp_diff / initial_temp) * 100 result = percent_decrease return result
The cost of a t-shirt is $20. If the store has a 10% discount on all items, what would be the final price of the t-shirt?
def solve() -> int: tshirt_cost = 20 discount_percentage = 10 discount_amount = tshirt_cost * (discount_percentage / 100) final_price = tshirt_cost - discount_amount result = final_price return result
Student: A movie theater charges $10 for a regular ticket and $8 for a senior ticket. The theater also offers a 10% discount for groups of 10 or more people. A group of 15 people, including 6 seniors, wants to watch a movie. What is the total price they will pay for the tickets after the discount?
def solve() -> int: regular_price = 10 senior_price = 8 group_size = 15 senior_count = 6 total_price = regular_price * (group_size - senior_count) + senior_price * senior_count discount_rate = 0.1 discount_amount = total_price * discount_rate final_price = total_price - discount_amount ...
am has a rectangular garden that is 8 meters long and 6 meters wide. He wants to plant roses along the perimeter of the garden. Each rose bush needs 0.5 meters of space. How many rose bushes can he plant?
def solve() -> int: perimeter = 8 + 8 + 6 + 6 bushes = perimeter / 0.5 result = bushes return result
If a recipe calls for 2/3 cup of flour and you want to make a half batch, how much flour do you need?
def solve() -> int: flour_needed = 2/3 half_batch = 0.5 new_amount = flour_needed * half_batch result = new_amount return result
A triangle has a base of 12 cm and a height of 9 cm. A parallelogram has a base of 8 cm and a height of 6 cm. How many parallelograms can fit into the triangle?
def solve() -> int: triangle_area = 1/2 * 12 * 9 parallelogram_area = 8 * 6 number_of_parallelograms = triangle_area // parallelogram_area result = number_of_parallelograms return result
Jack eats a bowl of oatmeal every morning for five days, but he doesn't eat on Saturday. If each bowl has 200 calories, how many calories did Jack consume during the week?
def solve() -> int: days_in_week = 7 days_eating_oatmeal = 5 calories_per_bowl = 200 total_calories = days_eating_oatmeal * calories_per_bowl result = total_calories return result
A school has 550 students in total. The number of boys is 3/5 of the number of girls. What is the total number of boys and girls in the school?
def solve() -> int: total_students = 550 boys = total_students/(3+5) girls = 3*boys result = boys + girls return result
There are 30 apples in a basket. 20% of them are rotten. How many apples are NOT rotten?
def solve() -> int: total_apples = 30 rotten_percent = 20 not_rotten_percent = 100 - rotten_percent not_rotten_count = total_apples * (not_rotten_percent / 100) result = not_rotten_count return result
A car dealership is selling a car for $20,000. The value of the car depreciates 10% each year. What will be the value of the car after 4 years?
def solve() -> int: car_price = 20000 depreciation_rate = 0.1 years = 4 current_price = car_price*(1-depreciation_rate)**years result = current_price return result
Student: 8. Nashira has a bag of 10 cookies. She ate 3/8 of them, how many cookies does Nashira have left?
def solve() -> int: cookies = 10 fraction_eaten = 3/8 cookies_eaten = fraction_eaten * cookies cookies_left = cookies - cookies_eaten result = cookies_left return result
If Jane gives Sarah 25% of her money, both of them will have the same amount. If Jane started with $80, how much did Sarah have at the beginning?
def solve() -> int: jane_money = 80 sarah_money = jane_money * 0.25 / 0.75 result = sarah_money return result
Student: Eva is buying some books for her summer reading. She wants to buy 4 novels, 2 biographies, and 1 cookbook. One novel costs $15, and one biography costs $18. One cookbook costs $2 more than one biography. How much Eva needs to pay for the books she wants to buy?
def solve() -> int: novel_price = 15 biography_price = 18 cookbook_price = biography_price + 2 total_novel_price = novel_price * 4 total_biography_price = biography_price * 2 total_cookbook_price = cookbook_price * 1 total_price = total_novel_price + total_biography_price + total_cookbook_pr...
Mark went shopping for the weekend. He bought 5 tees for $15 each, 2 sweaters for $25 each, and 8 hats for $10 each. How much money did Mark spend in total?
def solve() -> int: total = 0 x = 5 y = 2 z = 8 total += x * 15 total += y * 25 total += z * 10 result = total return result
Student: John goes shopping and buys 3 pairs of socks and 2 pairs of shoes. The socks cost $5 a pair, and the shoes cost $70 a pair. If there's a 10% discount on all items and John pays with a $100 bill, how much change does he receive?
def solve() -> int: socks_price = 5 shoes_price = 70 socks_quantity = 3 shoes_quantity = 2 discount = 0.1 total_cost = (socks_price * socks_quantity + shoes_price * shoes_quantity) * (1 - discount) change = 100 - total_cost result = change return result
Alex, Max, and Leo have some money. Alex has $15 less than Max, and Max has $11 less than Leo. If Leo has $42, how much money, in dollars, do all 3 of them have in total?
def solve() -> int: leo_money = 42 max_money = leo_money + 11 alex_money = max_money - 15 total_money = leo_money + max_money + alex_money result = total_money return result
Josh bought 7 shirts. The first 4 shirts are $15 each, the last 3 are $20 each. What is the total price, in dollars, of the 7 shirts?
def solve() -> int: cost_of_first_4_shirts = 15 * 4 cost_of_last_3_shirts = 20 * 3 total_cost = cost_of_first_4_shirts + cost_of_last_3_shirts result = total_cost return result
Three planes are flying to a location. The first plane carries 70 passengers, the second carries 80, and the third plane carries 50. Each passenger slows down the plane by 1 mi/h. What is the average speed of the planes where the empty plane can fly at 500 mi/h?
def solve() -> int: plane1_passengers = 70 plane2_passengers = 80 plane3_passengers = 50 empty_plane_speed = 500 total_passengers = plane1_passengers + plane2_passengers + plane3_passengers total_passenger_speed_reduction = total_passengers average_speed = (empty_plane_speed * 3 - ...
Student: A car travels a distance of 320 miles in 8 hours. What is its average speed in kilometers per hour?
def solve() -> int: distance_miles = 320 time_hours = 8 distance_km = distance_miles * 1.60934 time_seconds = time_hours * 3600 speed_kmph = distance_km / (time_seconds / 3600) result = speed_kmph return result
In a store, there are 600 shelves. The shelves are evenly spread across 8 aisles. How many more shelves can one aisle accommodate if there are already 32 filled shelves on that aisle?
def solve() -> int: num_shelves = 600 num_aisles = 8 filled_shelves = 32 total_filled_shelves = num_aisles * filled_shelves total_empty_shelves = num_shelves - total_filled_shelves empty_shelves_per_aisle = total_empty_shelves // num_aisles extra_shelves_per_aisle = empty_shelves_per_ai...
Student: Harry purchased a laptop for $1200 and a printer for $300. If he sells the laptop for a 10% profit and the printer for a 5% loss, what is the total amount of profit/loss he makes after selling both items?
def solve() -> int: laptop_price = 1200 printer_price = 300 laptop_profit = laptop_price * 0.1 printer_loss = printer_price * 0.05 total_profit_loss = laptop_profit + printer_loss result = total_profit_loss return result
Tina reads 12 pages of a book every day from Monday to Thursday, and 16 pages every day from Friday to Sunday. How many pages will she read in a month with 31 days?
def solve() -> int: total = 0 for day in range(1, 32): if day % 7 in (1, 2, 3, 4): total += 12 else: total += 16 result = total return result
A car salesman makes 18 sales on the first day of the month. Each subsequent day, he makes two fewer sales than the previous day. How many sales will he have made by the end of the 20th day of the month?
def solve() -> int: sales_first_day = 18 sales_per_day_decrease = 2 total_days = 20 sales_last_day = sales_first_day - (total_days - 1) * sales_per_day_decrease total_sales = (sales_first_day + sales_last_day) * total_days // 2 result = total_sales return result
A bank gives a starting interest rate of 2%. Every day, the interest rate increases by 0.1% more than the previous day. What will be the total interest earned after a week on a $1000 deposit?
def solve() -> int: interest = 0 deposit = 1000 for day in range(1, 8): interest = deposit * (0.02 + (day * 0.001)) total_interest = interest * 7 result = total_interest return result
Student: You have tape that you can cover an area of 1 square yard with. You want to cover an area of 256 square yards. How many rolls of tape do you need?
def solve() -> int: area_of_one_roll = 1 area_to_be_covered = 256 number_of_rolls = area_to_be_covered / area_of_one_roll result = number_of_rolls return result
Possible questions and programs are: James sold 20 bracelets at a craft fair. Each bracelet cost $5. He paid $15 for the materials and $10 for the table rental. How much profit did James make?
def solve() -> int: bracelets = 20 cost = 5 materials = 15 rental = 10 revenue = bracelets * cost expenses = materials + rental profit = revenue - expenses result = profit return result
Ben invested $1000 in a fixed deposit for 5 years at the rate of 8% per annum. What will be his total investment after 5 years?
def solve() -> int: principal = 1000 rate = 8 time = 5 total_investment = principal*(1 + rate/100)**time result = total_investment return result
In a local bakery, they make 10 different types of cakes. Each type of cake requires a different number of eggs to make. The number of eggs required for each type of cake is as follows: 3, 4, 2, 5, 6, 3, 2, 4, 5, and 6 eggs respectively. If the bakery makes 20 cakes of each type, how many eggs are required in total?
def solve() -> int: eggs_required = [3, 4, 2, 5, 6, 3, 2, 4, 5, 6] cakes_per_type = 20 total_eggs = sum(eggs_required) * cakes_per_type result = total_eggs return result
Jordan was 20 years old when his mother was three times as old as him. If in 7 years, Jordan's mother will be twice as old as he is currently, and his father is 4 years older than his mother, how old is Jordan's father?
def solve() -> int: jordan_age = 20 mother_age = 3 * jordan_age jordan_age_in_7_years = jordan_age + 7 mother_age_in_7_years = 2 * jordan_age father_age = mother_age + 4 result = father_age return result
A rectangular box has a length of 6 inches, a width of 3 inches, and a height of 2 inches. What is the volume of the box in cubic feet?
def solve() -> int: cubic_inches = 6 * 3 * 2 cubic_feet = cubic_inches / 1728 result = cubic_feet return result
If David drives at a speed of 50 km/h, how long will it take him to travel 150 kilometers?
def solve() -> int: speed = 50 distance = 150 time = distance / speed result = time return result
Mark buys 6 shirts, 3 pairs of pants, and 1 jacket for his winter wardrobe. If he wants to have enough clothes for the whole week, how many clothing items did he purchase in total?
def solve() -> int: shirts = 6 pants = 3 jacket = 1 total_items = shirts + pants + jacket total_items *= 7 result = total_items return result
Lily and Ben are building a treehouse. Lily has 20 wooden planks and Ben has 18 wooden planks. If each plank is 1 meter long and they need 30 meters of planks to complete the treehouse, how many more meters of planks do they need to obtain?
def solve() -> int: lily_planks = 20 ben_planks = 18 plank_length = 1 total_planks_needed = 30 total_planks_available = lily_planks + ben_planks total_meters_available = total_planks_available * plank_length meters_needed = total_planks_needed - total_meters_available resu...
In a class of 35 students, 25 percent of them are boys. How many girls are there in the class?
def solve() -> int: total_students = 35 boys_percentage = 25 girls_percentage = 100 - boys_percentage girls = total_students * girls_percentage / 100 result = girls return result
Possible questions and programs: Anne bought 12 apples and 8 oranges at the market. She ate 3 apples and gave 2 oranges to her friend. Then she bought 5 more oranges at a different stall. How many pieces of fruit does Anne have now?
def solve() -> int: apples = 12 oranges = 8 apples = apples - 3 oranges = oranges - 2 oranges = oranges + 5 fruit = apples + oranges result = fruit return result
A company has a budget of $1500 for office supplies. If they have already spent $795, how much money do they have left in their budget?
def solve() -> int: total_budget = 1500 spent_amount = 795 remaining_budget = total_budget - spent_amount result = remaining_budget return result
Paul has a rectangular garden with a perimeter of 40 feet. The width of the garden is 8 feet. Find the length of the garden.
def solve() -> int: perimeter = 40 width = 8 length = (perimeter - 2 * width) / 2 result = length return result
Student: Tom has invested $10,000 for 5 years at an annual interest rate of 8%. How much is the total interest earned after five years?
def solve() -> int: P = 10000 r = 0.08 t = 5 I = P * r * t result = I return result