question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A department store offers a 20% discount on all items. A customer buys three shirts that cost $25.00 each. What is the total price of the shirts after the discount?
def solve() -> int: shirt_price = 25.00 discount_percent = 0.20 shirt_count = 3 total_price = shirt_price * shirt_count discounted_price = total_price - total_price * discount_percent result = f'<<<{discounted_price}>>>' result = discounted_price return result
Emily is making 12 pieces of jewelry for her business, but she has to manage her time efficiently. She spends 3 hours in her workshop where she designs, creates, and finalizes her pieces. Each piece takes 10 minutes to design, then it takes 20 minutes to finalize all of her jewelry. How many minutes did it take Emily t...
def solve() -> int: num_pieces = 12 workshop_time = 3 * 60 design_time = num_pieces * 10 finalize_time = 20 total_time = workshop_time + design_time + finalize_time time_per_piece = total_time / num_pieces result = time_per_piece return result
A person wants to buy 4 items that cost $9.75 each. If they have a 10% off coupon, how much money will they save?
def solve() -> int: num_items = 4 individual_cost = 9.75 discount_percent = 10 discounted_individual_cost = individual_cost * ((100 - discount_percent) / 100) discount_amount = individual_cost - discounted_individual_cost total_cost = num_items * discounted_individual_cost total_savings = nu...
Sam has a rectangular garden that is 12 meters long and 9 meters wide. He wants to plant carrots in a square patch that covers 1/9 of the garden area. How long is the side of the square patch?
def solve() -> int: length = 12 width = 9 area = length * width patch_area = area / 9 side = patch_area ** 0.5 result = side return result
Mike invested $6,000 and earned 8% compounded annually. After 3 years, he withdrew $2,000 and reinvested the rest for another 3 years earning 12% compounded semi-annually. How much money does he have now?
def solve() -> int: principal1 = 6000 rate1 = 0.08 time1 = 3 interest1 = principal1 * ((1 + (rate1/1)) ** (1*time1)) withdrawal = 2000 rest_of_principal1 = principal1 - withdrawal principal2 = rest_of_principal1 rate2 = 0.12 semi_annual_rate2 = rate2/2 time2 = 6 ...
John is painting a room. He can paint 50 square feet per hour. The room he is painting is 10 feet high, 12 feet wide, and 14 feet long. How many hours will it take John to paint the walls of the room?
def solve() -> int: height = 10 width = 12 length = 14 area = 2 * height * (width + length) paint_rate = 50 hours = area / paint_rate result = hours return result
A school has a total of 150 students. If the ratio of boys to girls is 2:3, how many boys and girls are in the school?
def solve() -> int: total_students = 150 boy_fraction = 2/5 girl_fraction = 3/5 boys_count = total_students * boy_fraction girls_count = total_students * girl_fraction result = (boys_count, girls_count) return result
John earns $10 per hour. He worked 8 hours yesterday and 5 hours today, and then spent $30 on food. How much money does he have left?
def solve() -> int: hourly_rate = 10 hours_worked_yesterday = 8 hours_worked_today = 5 total_hours_worked = hours_worked_yesterday + hours_worked_today total_earned = total_hours_worked * hourly_rate total_left = total_earned - 30 result = total_left return result
Michael and Brenda have car dealerships that sell different car brands. In 2017, Michael made $12000 less than Brenda made in sales. However, in 2018, Michael made 10% more money than Brenda made in 2017. If Brenda earned $50000 in 2017, what were Michael's total earnings in the two years?
def solve() -> int: brenda_earnings_2017 = 50000 michael_earnings_2017 = brenda_earnings_2017 - 12000 michael_earnings_2018 = 1.1 * brenda_earnings_2017 total_earnings = michael_earnings_2017 + michael_earnings_2018 result = total_earnings return result
For every book Lisa sells, she is paid $6 more than she is paid to read the book. If Lisa gets $3 to read the book, how much does she get paid to sell and read 10 books?
def solve() -> int: book_payment = 3 selling_payment = book_payment + 6 total_books = 10 total_payment = (book_payment + selling_payment) * total_books result = total_payment return result
Alex has a monthly salary of $5500. She spends $2000 on rent, $250 on utilities, $750 on groceries, and $200 on miscellaneous expenses. Can Alex afford to make a monthly car payment of $400?
def solve() -> int: salary = 5500 rent = 2000 utilities = 250 groceries = 750 miscellaneous = 200 car_payment = 400 expenses = rent + utilities + groceries + miscellaneous + car_payment if expenses <= salary: result = "Alex can afford to make the car payment." else: ...
Melissa drove her car for 50 miles. She used 4 gallons of gas. How many miles per gallon did her car get?
def solve() -> int: milesDriven = 50 gasUsed = 4 milesPerGallon = milesDriven / gasUsed result = milesPerGallon return result
Kelly wants to buy a new fridge. It costs $500 with 10% sales tax, how much will Kelly need to pay in total?
def solve() -> int: price = 500 sales_tax = 10 total_price = price + price * (sales_tax/100) result = total_price return result
Emily is running a catering business. She charges $8 for a plate of pasta and $10 for a plate of steak. If she has 20 pasta plates and 12 steak plates for an event, how much money will she earn?
def solve() -> int: pasta_price = 8 steak_price = 10 pasta_plates = 20 steak_plates = 12 pasta_earnings = pasta_price * pasta_plates steak_earnings = steak_price * steak_plates total_earnings = pasta_earnings + steak_earnings result = total_earnings return result
Zoe works part-time at a bookshop and is paid every two weeks. She saves $50 from each pay and spends the rest on her college expenses. If she earned $2000 this month, how much money did she spend on her college expenses?
def solve() -> int: earnings = 2000 savings_per_pay = 50 total_savings = earnings // 2 * savings_per_pay college_expenses = earnings - total_savings result = college_expenses return result
Caroline bought a set of books for $102. She then bought 1 additional books at a cost 3 times greater than the book in the set for a total of 120$. How much did the books in the set originally cost?
def solve() -> int: total_cost_set = 102 additional_book_cost = 120 - total_cost_set single_book_cost = additional_book_cost/3 total_cost_set = single_book_cost * 8 result = total_cost_set return result
Jane has 1000 dollars in her savings account. If she wants to save 20% of it to buy a new phone, how much money will she have left in her account?
def solve() -> int: total_money = 1000 percent_saved = 0.2 amount_saved = total_money * percent_saved money_left = total_money - amount_saved result = money_left return result
A school has 1200 students, out of which 60% are girls. How many girls are there in the school?
def solve() -> int: total_number_of_students = 1200 percentage_of_girls = 60 number_of_girls = total_number_of_students * percentage_of_girls / 100 result = number_of_girls return result
A train covers a distance of 360 km in 4 hours 30 minutes. What is its speed in kmph?
def solve() -> int: total_time = 4 + 30/60 speed = 360/total_time result = speed return result
A basketball player makes 80% of his free throw shots. If he attempts 25 free throws, how many does he make?
def solve() -> int: free_throw_percentage = 0.8 attempts = 25 made = free_throw_percentage * attempts result = f'{made}' result = made return result
1. How much money does Sarah have if she has $15 and spends 5/8 of it?
def solve() -> int: amount = 15 fraction = 5/8 result = amount - (amount * fraction) return result
A bag contains a total of 40 white, blue, and red marbles in the ratio 3:4:5 respectively. What is the total number of blue and red marbles in the bag?
def solve() -> int: white_marbles = 3 blue_marbles = 4 red_marbles = 5 total_marbles = white_marbles + blue_marbles + red_marbles blue_and_red_marbles = blue_marbles + red_marbles result = blue_and_red_marbles return result
If a room is 12 feet long, 10 feet wide and 8 feet high, what is the volume of the room in cubic feet?
def solve() -> int: length = 12 width = 10 height = 8 volume = length*width*height result = volume return result
``` A shelf can hold a maximum of 60 books. Jane has 72 books. If she has 3 shelves, how many books will be left without a place on a shelf?
def solve() -> int: max_books_per_shelf = 60 num_shelves = 3 total_books = 72 books_left = total_books - (max_books_per_shelf * num_shelves) result = books_left return result
The music club sold 40 tickets for their concert for $5 each and 25 CDs for $8 each. Then they used $150 to rent a hall for the concert and $75 to buy snacks and drinks for the audience. The rest of the money was split equally among the 10 club members. How much money did each club member get?
def solve() -> int: total_earned = 40*5 + 25*8 money_spent = 150 + 75 money_left = total_earned - money_spent money_per_member = money_left / 10 result = money_per_member return result
Sarah is redecorating her room and needs wallpaper. She uses 3 equal-sized rolls of wallpaper and adds the wallpaper she gets to the 11 feet she already has. She now has 34 feet of wallpaper. How many feet of wallpaper did she get from each roll?
def solve() -> int: rolls = 3 initial_wallpaper = 11 total_wallpaper = 34 wallpaper_from_rolls = total_wallpaper - initial_wallpaper wallpaper_per_roll = wallpaper_from_rolls / rolls result = wallpaper_per_roll return result
Olivia wants to build a tower of playing cards that's six levels tall. Each level of the tower has a square base where each side is one card shorter than the level above it. The top level is just one card. How many cards does Olivia need?
def solve() -> int: top_level = 1 total_cards = 0 for level in range(1, 7): level_cards = level ** 2 total_cards += level_cards result = total_cards return result
A company charges $9.99 for each product. If you buy 20 or more products with the offer "buy 1 get 1 free", how much do 50 products cost?
def solve() -> int: num_products = 50 price_per_product = 9.99 num_free_products = num_products // 2 num_pay_products = num_products - num_free_products total_price = num_pay_products * price_per_product result = total_price return result
There are 600 students in a school, 63% of them are boys, what percentage are girls?
def solve() -> int: total_students = 600 boy_percent = 0.63 girl_percent = 1 - boy_percent result = girl_percent return result
A store is offering a discount of fifteen percent on all items. If a jacket originally costs $80, by how much is it discounted?
def solve() -> int: discount_amount = 0.15 * 80 result = discount_amount return result
Maria's home wifi password consists of a string of nine random lowercase letters, a string of three alternating uppercase letters and numbers, and two symbols at either end of the password. How many characters are in Maria's password?
def solve() -> int: symbols = 2 lowercase_letters = 9 uppercase_letters_numbers = 3 password_length = symbols + lowercase_letters + uppercase_letters_numbers result = password_length return result
If six workers can construct five houses in ten weeks, how long will it take eight workers to construct four houses?
def solve() -> int: num_workers_1 = 6 num_houses_1 = 5 num_weeks_1 = 10 num_workers_2 = 8 num_houses_2 = 4 total_work = num_workers_1 * num_houses_1 * num_weeks_1 num_weeks_2 = total_work / (num_workers_2 * num_houses_2) result = num_weeks_2 return result
A cake recipe calls for 2 cups of flour, 1.5 cups of sugar, and 1 cup of milk. If Anna wants to make 3 cakes, how much flour, sugar, and milk will she need?
def solve() -> int: flour_per_cake = 2 sugar_per_cake = 1.5 milk_per_cake = 1 num_cakes = 3 flour_needed = flour_per_cake * num_cakes sugar_needed = sugar_per_cake * num_cakes milk_needed = milk_per_cake * num_cakes result = (flour_needed, sugar_needed, milk_needed) return result
At a park, 45% of the visitors are families. If 200 people visited the park, how many of them are families?
def solve() -> int: total_people = 200 families = 0.45 * total_people result = families return result
Student: In a school, there are 7 classes each made up of 16 students. How many students are in the school in total?
def solve() -> int: classes = 7 students_per_class = 16 total_students = classes * students_per_class result = total_students return result
A cat's tail is one-fourth its length. If a cat is 20 inches long, calculate the area of a rectangle with the same length and width as the tail.
def solve() -> int: cat_length = 20 tail_length = cat_length / 4 tail_width = tail_length area = tail_length * tail_width result = area return result
Emily practices singing three times as often as her sister. If her sister practices for a total of 8 hours every week, and each practice session is 40 minutes long, how many hours of singing practice does Emily get to choose?
def solve() -> int: sister_practice_time = 8 * 60 sister_practice_session = 40 emily_practice_time = sister_practice_time * 3 emily_practice_hours = emily_practice_time / 60 result = emily_practice_hours return result
A student spends 45 minutes on math homework, 30 minutes on science homework, and 20 minutes on English homework. How many hours did the student spend on homework in total?
def solve() -> int: math_time = 45 science_time = 30 english_time = 20 total_time = (math_time + science_time + english_time) / 60 result = total_time return result
Mark changes the oil of 4 cars in his street. Each car needs 5 quarts of oil. If a quart of oil costs $3.50, how much money does Mark spend on oil?
def solve() -> int: cars = 4 quarts_per_car = 5 cost_per_quart = 3.50 total_quarts = cars * quarts_per_car total_cost = total_quarts * cost_per_quart result = total_cost return result
A recipe calls for 3 cups of flour and makes 12 cookies. If you want to make 24 cookies, how many cups of flour do you need?
def solve() -> int: cups_of_flour = 3 cookies = 12 desired_cookies = 24 flour_needed = (cups_of_flour/cookies) * desired_cookies result = flour_needed return result
Alicia bakes 6 trays of cupcakes for a bake sale. Each tray has 24 cupcakes. How many cupcakes did Alicia bake in total?
def solve() -> int: trays = 6 cupcakes_per_tray = 24 total_cupcakes = trays * cupcakes_per_tray result = total_cupcakes return result
A bag of candy costs $4. If each piece of candy costs $0.20, how many pieces are in the bag?
def solve() -> int: cost_of_bag = 4 cost_per_candy = 0.20 num_candies = cost_of_bag / cost_per_candy result = num_candies return result
Zoe runs up and down a 6-flight staircase 5 times a day, from Monday to Friday. If each flight is 18 feet tall, what is the total travel distance in feet that she covers over the week?
def solve() -> int: flights_per_day = 6 times_per_week = 5 flight_height = 18 total_distance = flights_per_day * flight_height * 2 * times_per_week result = total_distance return result
Kelly is writing a novel. She needs to complete 10 chapters, each of which has 4 sections. Kelly can write a section in 20 minutes, and it takes her 10 minutes to take a break between each section. If Kelly splits the work with her sister who's equally fast as her, how long, in hours, will it take them to finish the en...
def solve() -> int: chapters = 10 sections_per_chapter = 4 total_sections = chapters * sections_per_chapter time_per_section = 20 break_time = 10 total_time_per_section = time_per_section + break_time total_time_per_chapter = total_time_per_section * sections_per_chapter total_time_...
In a survey of 200 people, 35% of them said they prefer pizza over any other food. If 60% of the pizza lovers prefer pepperoni pizza, how many people said they prefer pepperoni pizza?
def solve() -> int: num_pizza_lovers = 200 * 0.35 num_pepperoni_lovers = num_pizza_lovers * 0.6 result = num_pepperoni_lovers return result
If a company sells 1000 products for $2.50 each, how much revenue do they generate in total?
def solve() -> int: price_per_product = 2.5 num_products = 1000 revenue = price_per_product * num_products result = revenue return result
A movie ticket costs $10 normally. On Tuesdays and Wednesdays, they are 20% off. If you go with a friend, you can get an additional 10% off. If two friends go to the movie on a Tuesday or Wednesday, how much do they pay?
def solve() -> int: price = 10 * 2 discount = price * 0.2 price -= discount discount = price * 0.1 price -= discount result = round(price, 2) return result
John has 35 marbles. If he found 50 more marbles, how many marbles does he have now?
def solve() -> int: marbles = 35 found_marbles = 50 total_marbles = marbles + found_marbles result = total_marbles return result
A box measures 10 cm in length, 8 cm in width, and 6 cm in height. What is the total volume and surface area of the box?
def solve() -> int: length = 10 width = 8 height = 6 volume = length * width * height surface_area = 2 * (length * width + width * height + height * length) result = (volume, surface_area) return result
At a burger joint, 3 friends share 5 burgers and 12 fries. If each burger costs $3 and each fry costs $1, what is the total cost of the food they ordered?
def solve() -> int: num_burgers = 5 num_fries = 12 cost_burger = 3 cost_fry = 1 total_cost = (num_burgers * cost_burger) + (num_fries * cost_fry) result = total_cost return result
Doug has 50 books that cost him $8.50 each, how much did Doug spend on books?
def solve() -> int: price_per_book = 8.50 total_books = 50 total_cost = price_per_book * total_books result = total_cost return result
Emily has 12 dolls and 8 teddy bears. She gives away half of her dolls and a third of her teddy bears to her friends. She then receives 4 more dolls and 6 more teddy bears as a birthday present. How many dolls and teddy bears does she have in total?
def solve() -> int: dolls = 12 teddy_bears = 8 dolls = dolls - dolls // 2 teddy_bears = teddy_bears - teddy_bears // 3 dolls = dolls + 4 teddy_bears = teddy_bears + 6 total = dolls + teddy_bears result = total return result
Possible questions: A car travels 120 miles on a highway at a speed of 60 miles per hour. How much time would it save if it increased its speed to 80 miles per hour?
def solve() -> int: time_60 = 120 / 60 time_80 = 120 / 80 time_saved = time_60 - time_80 result = time_saved return result
While gardening, Tyler planted 32 flowers. Dylan planted 16 flowers. If Sofia planted one-fifth the amount of flowers as Tyler and Sam planted three times the amount of flowers as Dylan, how many flowers were planted in total?
def solve() -> int: tyler_flowers = 32 dylan_flowers = 16 sofia_flowers = tyler_flowers / 5 sam_flowers = dylan_flowers * 3 total_flowers = tyler_flowers + dylan_flowers + sofia_flowers + sam_flowers result = total_flowers return result
A jar contains 125 marbles. If the ratio of red marbles to blue marbles is 2:3, how many blue marbles are in the jar?
def solve() -> int: blue = 3 red = 2 total_marbles = 125 blue_number = int((blue / (blue + red)) * total_marbles) result = blue_number return result
Student: Alex collected 24 stones from the beach. He gave 3/8 of the stones to his sister. From the remaining stones, he distributed 5/9 equally to 3 of his friends. How many stones are left for him?
def solve() -> int: total_stones = 24 sister_share = 3/8 friend_share = 5/9 friend_number = 3 sister_stones = total_stones * sister_share sister_stones = int(sister_stones) left_stones = total_stones - sister_stones friend_stones = left_stones * friend_share / friend_number f...
A hotel room costs 120 dollars per night. If I want to stay for a week, how much will it cost me?
def solve() -> int: price_per_night = 120 number_of_nights = 7 total_price = price_per_night * number_of_nights result = total_price return result
A recipe calls for 3 cups of flour and 1/2 cup of sugar. If you halve the recipe, how much sugar do you need?
def solve() -> int: flour = 3 sugar = 1/2 reduced_recipe_factor = 1/2 sugar_in_reduced_recipe = sugar * reduced_recipe_factor result = sugar_in_reduced_recipe return result
In a restaurant, 40 new chairs were purchased last week. This week, the restaurant purchased triple the amount of chairs as last week. If there were already 80 chairs in the restaurant before last week, how many chairs are in the restaurant currently?
def solve() -> int: last_week_chairs = 40 this_week_chairs = last_week_chairs * 3 previous_chairs = 80 total_chairs = previous_chairs + last_week_chairs + this_week_chairs result = total_chairs return result
Mira is baking a cake for her friend's birthday. She needs 4 cups of flour, 3 eggs, 2 cups of sugar, and 1/4 cup of oil. She has 8 cups of flour, 12 eggs, 5 cups of sugar, and 1 cup of oil in her pantry. How many cakes can she make with the ingredients she has?
def solve() -> int: flour_cakes = 8 // 4 egg_cakes = 12 // 3 sugar_cakes = 5 // 2 oil_cakes = 1 // (1/4) min_cakes = min(flour_cakes, egg_cakes, sugar_cakes, oil_cakes) result = min_cakes return result
Student: 10. On average, a grocery store stocks 15 cartons of milk each day. How many cartons of milk will the store stock after 30 days?
def solve() -> int: cartons_per_day = 15 days = 30 total_cartons = cartons_per_day * days result = total_cartons return result
If the circumference of a circle is 88 cm, what is the radius of the circle?
def solve() -> int: x = 88 result = x/(2*3.1416) return result
A school has four times as many students as teachers. If there are 120 teachers in the school, how many students and how many people are there in the school?
def solve() -> int: teachers = 120 students = 4 * teachers total_people = teachers + students result = (students, total_people) return result
Ethan is going on a hike. He needs to climb a steep mountain and then descend the other side. The whole trek will take 12 hours. Descending takes one-third as long as ascending. How long does it take Ethan to ascend?
def solve() -> int: total_time = 12 ascend_time = total_time * 3 / 4 result = ascend_time return result
If Andrew spent $24 on $0.20 pencils and bought triple the number of pencils as Cathy who spent $12, and Kate bought 5 times as many pencils as Cathy, how many pencils did Andrew and Kate buy altogether?
def solve() -> int: andrew_spent = 24 pencil_price = 0.20 andrew_pencils = andrew_spent / pencil_price cathy_spent = 12 cathy_pencils = andrew_pencils * 1/3 kate_pencils = cathy_pencils * 5 total_pencils = andrew_pencils + kate_pencils result = total_pencils retur...
There are 65 shirts in the laundry. There are 47 jackets in the coat closet. If 51 clothes were washed and 1/4 of the jackets are hung, how many clothes are not washed and hung yet?
def solve() -> int: laundry_shirts = 65 coat_jackets = 47 washed_clothes = 51 hung_jackets = coat_jackets * 1/4 not_washed_hung_clothes = (laundry_shirts + coat_jackets) - (washed_clothes + hung_jackets) result = not_washed_hung_clothes return result
Ike walks for 30 minutes every day. If he walks at a pace of 3 miles per hour, how far does he walk every day?
def solve() -> int: walk_time = 30 / 60 pace = 3 distance = walk_time * pace result = distance return result
A class has 28 students. If there are 3 more boys than girls, how many boys and girls are in the class?
def solve() -> int: total_students = 28 girls = (total_students - 3) / 2 boys = girls + 3 result = boys, girls return result
David has six times as many dolls as Dana. Dana has 10 more than Dora, who has 15 dolls. How many dolls do David and Dora have?
def solve() -> int: dora = 15 dana = dora + 10 david = 6 * dana result = "David has " + str(david) + " dolls and Dora has " + str(dora) + " dolls" return result
I jog 3 miles in 25 minutes. What is my average speed in miles per hour?
def solve() -> int: distance = 3 time = 25/60 speed = distance/time result = speed return result
On Monday, Alyssa has 35 pencils. On Tuesday, she gives away a quarter of them. On Wednesday, she buys 20 more pencils. On Thursday, Alyssa buys a fifth of her original amount on Monday. How many pencils does she have on Thursday?
def solve() -> int: monday_pencils = 35 tuesday_pencils = monday_pencils * 0.75 wednesday_pencils = tuesday_pencils + 20 thursday_pencils = wednesday_pencils + (monday_pencils * 0.2) result = thursday_pencils return result
A garden has 600 flowers. If 60 flowers die every week, how many weeks will it take until the number of flowers in the garden reaches one-third of its initial number?
def solve() -> int: initial_flowers = 600 flowers_left = initial_flowers weeks = 0 while flowers_left > initial_flowers/3: flowers_left -= 60 weeks += 1 result = weeks return result
Student: A vase has 56 flowers and 7 flowers are in each bouquet. How many bouquets can you make with all the flowers?
def solve() -> int: flowers = 56 flowers_per_bouquet = 7 bouquets = flowers // flowers_per_bouquet result = bouquets return result
Student: Julie is driving from her house to the grocery store, 7 miles away. Afterwards, she will drive to the school 3 miles away, and then to the theater, 4 miles away. How many total miles will Julie drive before returning to her house?
def solve() -> int: house_to_store = 7 store_to_school = 3 school_to_theater = 4 total_distance = house_to_store + store_to_school + school_to_theater total_distance = total_distance * 2 result = total_distance return result
Rachel baked two-thirds of a chocolate cake. After dinner, she cut 8 pieces from the cake. If there were 26 pieces left, how many pieces were there initially?
def solve() -> int: cake = 1/3 * 2 pieces_left = 26 pieces_cut = 8 pieces_initial = (pieces_left + pieces_cut) / (1 - cake) result = pieces_initial return result
Jack wants to calculate the average price of three items he bought. The first item was $20, the second item was 10% off its original price of $35, and the third item was on sale for $15. What is the average price of the three items?
def solve() -> int: item1 = 20 item2 = 35 * 0.1 item3 = 15 average_price = (item1 + item2 + item3)/3 result = average_price return result
A garden measures 40 feet by 30 feet and has an area of 1200 square feet. There is a path around the garden that is 4 feet wide. What is the area, in square feet, of the path around the garden?
def solve() -> int: garden_area = 1200 garden_length = 40 garden_width = 30 path_width = 4 area_without_path = garden_area path_length = garden_length + (2 * path_width) path_width = garden_width + (2 * path_width) area_with_path = path_length * path_width area_of_path = area_with_pa...
Student: Tom has a pet bird and a pet hamster. He buys food for both of them for $40 in total a month. Tom has the bird for 6 months and the hamster for 8 months. If the weekly cost of the hamster food is $5, how much money did Tom already spend on food for his pets?
def solve() -> int: hamster_weekly_cost = 5 total_months = 6 + 8 total_cost = 40 * total_months hamster_total_cost = hamster_weekly_cost * 4 * 8 bird_total_cost = total_cost - hamster_total_cost result = bird_total_cost + hamster_total_cost return result
The average weight of 10 cats is 6 kg. If the weight of one of the cats is misrecorded as 4 kg instead of 8 kg, what is the correct average weight?
def solve() -> int: total_weight = 60 misrecorded_weight = 4 correct_weight = 8 correct_weight_of_all_cats = total_weight - misrecorded_weight + correct_weight correct_average_weight = correct_weight_of_all_cats / 10 result = correct_average_weight return result
A garden measures 12 meters by 15 meters. What is the perimeter of the garden?
def solve() -> int: length = 12 width = 15 perimeter = 2 * (length + width) result = perimeter return result
There were 400 people in the park for the charity walk. Before the walk ended, one-third of the men and one-sixth of the women left early. How many people remained on the walk if there were 160 women at the start of the walk?
def solve() -> int: total_people = 400 women = 160 men = total_people - women men_left = men / 3 women_left = women / 6 remaining_people = total_people - men_left - women_left result = remaining_people return result
At Tom's pet store, fish food costs $12 per kilogram on weekdays and $15 per kilogram on weekends. If Tom bought 3 kilograms of fish food on Saturday and 2 kilograms of fish food on Monday, how much did he spend in total?
def solve() -> int: cost_on_saturday = 15 * 3 cost_on_monday = 12 * 2 total_cost = cost_on_saturday + cost_on_monday result = total_cost return result
From a group of 28 students, 45% of them passed the exam. How many students failed the exam?
def solve() -> int: a = 28 b = 45 * a / 100 c = a - b result = c return result
Jane purchased a shirt for $100. She then had a 30% discount applied to her purchase. How much did Jane pay in total?
def solve() -> int: total = 0 original_price = 100 discount = 0.3 total = original_price * (1 - discount) result = total return result
A hydraulic lift cargo elevator takes 35 seconds to lift a load from the ground to a height of 12 meters. How much time will it take for an 18-meter lift?
def solve() -> int: time_taken = 35 initial_height = 12 final_height = 18 time_required = time_taken * ((final_height - initial_height) / initial_height) result = time_required return result
A car company pays its salespeople a commission of $300 per car sold, plus 15% of the car’s selling price. If you have sold three cars, one for $10,000, one for $11,000, and one for $12,000, how much commission will you receive?
def solve() -> int: car_1_price = 10000 car_2_price = 11000 car_3_price = 12000 total_cars_sold = 3 commission_per_car = 300 car_1_commission = commission_per_car + car_1_price * 0.15 car_2_commission = commission_per_car + car_2_price * 0.15 car_3_commission = commission_per_car + car_3...
Ava invested $500 in a bond that increases in value by 3/5. If she wants to get back her original investment, how much of her bond must she sell?
def solve() -> int: bond_value = 500 * (1 + 3/5) amount_to_sell = bond_value - 500 result = amount_to_sell return result
Student: Jane has 36 marbles. She gave 1/3 of them to her sister. How many marbles does she have left?
def solve() -> int: marbles = 36 marbles_given = marbles / 3 marbles_left = marbles - marbles_given result = marbles_left return result
If there are 8 tanks in a company and each tank has 12 liters of oil, how many liters of oil are in the company?
def solve() -> int: number_of_tanks = 8 liters_per_tank = 12 result = number_of_tanks * liters_per_tank return result
At the grocery store, 8 more packages of oranges were sold than apples. If 480 packages of apples were sold, how many packages of oranges were sold?
def solve() -> int: apples = 480 oranges = apples + 8 result = oranges return result
Nia wants to make a salad with lettuce, tomatoes, and cucumbers. She goes to the farmer's market where lettuce costs $3 per head, tomatoes cost $2 per pound, and cucumbers cost $1.5 per pound. For every 5 items that customers buy, the market gives a $2 discount. Nia buys 2 heads of lettuce, 3 pounds of tomatoes, and 2 ...
def solve() -> int: lettuce_price = 3 tomato_price = 2 cucumber_price = 1.5 lettuce_quantity = 2 tomato_quantity = 3 cucumber_quantity = 2 total_items = lettuce_quantity + tomato_quantity + cucumber_quantity discount = (total_items // 5) * 2 subtotal = (lettuce_price * let...
A gym charges $75 per month for a membership. If a member signs up for a yearly membership, the cost comes down to $750. What is the percentage discount the member gets by opting for a yearly membership?
def solve() -> int: percentage_discount = (1 - (750/12) / (75)) * 100 result = percentage_discount return result
In a race, John finished twice as fast as the slowest runner. If the fastest runner finished in 10 seconds and the range of finish times was 24 seconds, how fast did John finish?
def solve() -> int: fastest_runner = 10 range_of_finish_times = 24 slowest_runner = fastest_runner + range_of_finish_times - 10 john_finish_time = 2 * slowest_runner result = john_finish_time return result
Kim is a shopper who wants to know how much she will spend. Kim buys 10 shirts at $15 per shirt and 5 pairs of pants at $20 per pair. How much will Kim spend in total?
def solve() -> int: shirts = 10 shirt_price = 15 pants = 5 pants_price = 20 shirt_cost = shirts * shirt_price pants_cost = pants * pants_price total_cost = shirt_cost + pants_cost result = total_cost return result
Student: John needs to fill a tank with fuel in order to run some machinery. He needs to fill it twice with 3 liters of fuel each time. He needs to add twice more litres than before in order to complete the task. How many litres of fuel does he need in total?
def solve() -> int: x = 3 * 2 y = 2 * x z = x + y result = z return result
At a pet store, Mary saw 3 times as many turtles as scorpions, 2 times as many lizards as turtles, and ten more cats than lizards. How many animals were there in total?
def solve() -> int: Turtles = 0 Scorpions = 0 Cats = 0 Turtles = Scorpions * 3 Lizards = Turtles * 2 Cats = Lizards + 10 result = Turtles + Scorpions + Lizards + Cats return result
7. In a flower shop, there are 7 roses priced at $2 each, 9 tulips priced at $3 each, and 10 daisies priced at $1 each. How much does the shop charge for the entire bouquet?
def solve() -> int: num_roses = 7 price_roses = 2 num_tulips = 9 price_tulips = 3 num_daisies = 10 price_daisies = 1 total_roses = num_roses * price_roses total_tulips = num_tulips * price_tulips total_daisies = num_daisies * price_daisies total_cost = total_roses + total_tulips ...
A box contains 63 candies, of which 30% are chocolates and the rest are gummies. How many gummies are in the box?
def solve() -> int: total_candies = 63 chocolates = total_candies * 0.3 gummies = total_candies - chocolates result = gummies return result
If two-fifths of a pound of peaches cost $0.90, how many pounds can Rachel buy with $15?
def solve() -> int: cost_of_peaches = 0.90 pounds_of_peaches = 2/5 total_cost = 15 pounds_can_buy = total_cost / cost_of_peaches * pounds_of_peaches result = pounds_can_buy return result
Jessica buys a sewing machine for $250 and gets a $30 discount. She estimates that by making her own clothes, she'll save $8 per day. Before buying the sewing machine, she spent $10 per day on clothes. How long until the sewing machine pays for itself?
def solve() -> int: sewing_machine_cost = 250 discount = 30 savings_per_day = 8 previous_spending_per_day = 10 total_cost = sewing_machine_cost - discount daily_savings = savings_per_day - previous_spending_per_day days_to_pay_off = total_cost / daily_savings result = days...