question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Jessica bought 600 t-shirts and she asked her friends to help her sell them. If each friend can sell 1/4 of the t-shirts, how many t-shirts did each friend get?
def solve() -> int: total_shirts = 600 friend_shirts = total_shirts * 0.25 result = friend_shirts return result
Ryan can skate at 7 times the speed that Emma can. Emma can skate at one-sixth the speed that Kelly can. If Kelly can skate at a pace of 12 miles per hour, how fast can Ryan skate in miles per hour?
def solve() -> int: kelly = 12 emma = kelly/6 ryan = emma*7 result = ryan return result
A company has a workforce of 2000 employees. If 35% of the employees are part-time workers and part-time workers work an average of 20 hours per week, how many full-time employees are there assuming full-time workers work an average of 40 hours per week?
def solve() -> int: employees = 2000 part_time = 0.35 * employees part_time_hours = 20 full_time_hours = 40 full_time = (employees - part_time) * (full_time_hours / part_time_hours) result = full_time return result
A swimming pool takes 6 hours to fill with water using one hose. How long will it take to fill the pool if you use 2 hoses with the same flow rate?
def solve() -> int: time_needed = 6 * (1 / 2) result = time_needed return result
The length of a rectangle is three times the length of a smaller rectangle. The perimeter of the larger rectangle is 78 cm. What is the perimeter of the smaller rectangle?
def solve() -> int: perimeter_of_larger_rectangle = 78 length_ratio = 3 length_of_larger_rectangle = perimeter_of_larger_rectangle / 2 length_of_smaller_rectangle = length_of_larger_rectangle/length_ratio perimeter_of_smaller_rectangle = 2*(length_of_smaller_rectangle + length_of_larger_rectangle/le...
A rectangle has a length of 5 centimeters and a width of 3 centimeters. What is the area of the rectangle?
def solve() -> int: area = 5*3 result = area return result
Mia's baking recipe requires the same amount of sugar as Jack's. Lily's recipe uses one-fifth the total sugar between Mia and Jack's recipes. How much sugar is needed in total between the three recipes if when Lily forgot to add sugar, she had to throw away the cake?
def solve() -> int: Mia_sugar = 0 Jack_sugar = 0 Lily_sugar = 0 Mia_sugar = Jack_sugar Lily_sugar = (Mia_sugar + Jack_sugar) / 5 total_sugar = Mia_sugar + Jack_sugar + Lily_sugar result = total_sugar return result
Lily has 7 flowers. She has 6 more buttons than flowers. How many items does Lily have in all?
def solve() -> int: flowers = 7 buttons = flowers + 6 total_items = flowers + buttons result = total_items return result
Question1: A toy car costs $30 and increases by 10% each month. Calculate the cost after two months.
def solve() -> int: price = 30 price = price + (price*0.1) price = price + (price*0.1) result = price return result
Two cars are running a race on a circular track. The first car completes two laps in 200 seconds, while the second car completes one lap in 400 seconds. What is the average speed of each car?
def solve() -> int: time1 = 200 time2 = 400 lap1 = 2 lap2 = 1 distance = lap1 + lap2 total_time = time1 + time2 avg_speed1 = lap1 * distance / time1 avg_speed2 = lap2 * distance / time2 result = [avg_speed1, avg_speed2] return result
During a sale, a store reduces the prices of all items by 20%. If the original price of a shirt is $30, what is the sale price?
def solve() -> int: original_price = 30 sale_reduction = 0.2 sale_price = original_price * (1 - sale_reduction) result = sale_price return result
Lisa can swim at a speed of 2 miles per hour in still water, but the current of a river affects her speed. If the current flows at 0.5 miles per hour in the same direction as Lisa, she swims faster. If the current flows at 0.5 miles per hour in the opposite direction, she swims slower. If Lisa swims for 15 minutes with...
def solve() -> int: with_time = 15 / 60 against_time = 15 / 60 with_speed = 2 + 0.5 against_speed = 2 - 0.5 with_distance = with_speed * with_time against_distance = against_speed * against_time total_distance = 2 * with_distance + against_distance result = total_dist...
Jenny can run 8 kilometers in 40 minutes. What is her average speed in meters per second?
def solve() -> int: meters = 8 * 1000 seconds = 40 * 60 speed = meters / seconds result = speed return result
A box contains 80 candies. If the candies are equally distributed into 8 bags, how many candies are in each bag?
def solve() -> int: total_candies = 80 bags = 8 candies_per_bag = total_candies / bags result = candies_per_bag return result
In 9 years, Daniel will be 4 times as old as Susan. If Daniel is currently 18 years old, how old is Susan today?
def solve() -> int: daniel_age = 18 years_passed = 9 susan_age_in_9_years = (daniel_age + years_passed) / 4 susan_age = susan_age_in_9_years - years_passed result = susan_age return result
Michael works for 8 hours per day. Sixteen times the time he spends working on a project is equal to the amount of money he earns (in dollars). How much money will Michael earn if he works on a project for 4 hours each day for 5 days?
def solve() -> int: hours_per_day = 8 project_hours_per_day = 4 days_worked = 5 total_project_hours = project_hours_per_day * days_worked total_hours_worked = hours_per_day * days_worked money_earned = 16 * total_project_hours result = money_earned return result
A library lends out 30 books each hour during the week and a total of 250 books over the weekend. If the library is open for 8 hours a day, how many books are lent out in a week?
def solve() -> int: weekday_books_per_hour = 30 weekend_books_total = 250 hours_per_day = 8 weekday_books_total = weekday_books_per_hour * hours_per_day * 5 week_books_total = weekday_books_total + weekend_books_total result = week_books_total return result
Student: $300 was divided equally among David, Emma, and Fred. David saved 1/4 of his share, Emma spent 1/3 of her share on clothes, and Fred gave 1/6 of his share to his sister. How much money did Fred have left?
def solve() -> int: david_share = 300 / 3 emma_share = 300 / 3 fred_share = 300 / 3 david_saved = david_share * 1/4 emma_spent = emma_share * 1/3 fred_gave = fred_share * 1/6 fred_left = fred_share - fred_gave total_amount = david_share + emma_share + fred_share total_left = david_sa...
Akilah decided to purchase a new laptop for $1,599. She was given an 18% discount on the laptop. How much did Akilah pay for the laptop?
def solve() -> int: price = 1599 discount = price * 0.18 final_price = price - discount result = final_price return result
A bag contains 20 marbles, 8 of which are blue and the rest are red. What is the percentage of red marbles in the bag?
def solve() -> int: red_marbles = 20 - 8 percentage_red = (red_marbles / 20) * 100 result = percentage_red return result
A computer program runs a simulation which takes 10 seconds. If the program runs the simulation 1000 times, how many hours will it take to run the simulations?
def solve() -> int: total_seconds = 10 * 1000 hours_needed = (total_seconds/60)/60 result = hours_needed return result
Student: Aditi has 78 candy pieces. She gives away the same number of candy pieces to her two friends. How many candy pieces does each person get?
def solve() -> int: total = 78 per_person = total // 3 result = per_person return result
Student: On a basketball team, there are 10 players. Each player scored 5 points in the game. What was the total score of the team?
def solve() -> int: num_players = 10 points_per_player = 5 total_score = num_players * points_per_player result = total_score return result
You have a rectangular garden that is 8 feet long and 6 feet wide. If you want to add a border of flowers around the garden, and each flower bed is 1 foot wide, how many square feet of flowers will you need?
def solve() -> int: garden_length = 8 garden_width = 6 flower_bed_width = 1 new_length = garden_length + 2 * flower_bed_width new_width = garden_width + 2 * flower_bed_width total_flower_area = (new_length * new_width) - (garden_length * garden_width) result = total_flower_area return re...
At Emma's restaurant, 40% of the staff are chefs and the rest are waiters. Of the chefs, 80% have a culinary degree and 4 do not. How many waiters work at Emma's restaurant?
def solve() -> int: staff = 100 chefs = staff * 0.4 chefs_with_degree = chefs * 0.8 chefs_without_degree = 4 waiters = staff - chefs result = waiters return result
Ava is filling a fuel tank and wants to make sure it doesn't overflow. The tank can hold up to 40 gallons and she has 12 cans of gas to fill it. She has 6 cans that each hold 3 gallons, 3 cans that each hold 2 gallons, and 3 cans that each hold 1 gallon. In gallons, how much gas does Ava need to pour out to keep it wit...
def solve() -> int: cans_3 = 6 cans_2 = 3 cans_1 = 3 total_gas = cans_3 * 3 + cans_2 * 2 + cans_1 * 1 max_capacity = 40 excess_gas = total_gas - max_capacity result = excess_gas return result
Ethan has a square pool that is 24 feet by 24 feet. If the pool is being emptied at a rate of 5 cubic feet per minute, how long will it take to drain completely?
def solve() -> int: length = 24 width = 24 depth = length volume = length * width * depth rate = 5 time = volume / rate result = time return result
A company sells apples at $0.50 a piece. If a customer buys more than 20 apples, they get a 10% discount. If Alicia wants to buy 35 apples, how much will she pay?
def solve() -> int: price_of_apple = 0.5 num_of_apples = 35 discount_percentage = 0.1 if num_of_apples > 20: price_before_discount = num_of_apples * price_of_apple discount_amount = price_before_discount * discount_percentage price_after_discount = price_before_discount - discount_amou...
Alex has 150 dollars in his bank account. He spends 10 dollars every day to buy coffee and snacks. If he also withdraws 40 dollars every week to buy groceries, how much money will be left after 3 weeks?
def solve() -> int: daily_spending = 10 weekly_withdrawal = 40 weeks = 3 starting_money = 150 total_spent = daily_spending * 7 * weeks + weekly_withdrawal * weeks remaining_money = starting_money - total_spent result = remaining_money return result
Ella had 3/5 of a carton of milk that she had poured for Hannah's cereal. Ava had also poured some milk for Hannah's cereal, but she only poured 1/4 of what Ella poured. Jacob had brought 12 more ounces of milk than Ella and Ava together. If Hannah had a carton of milk already, how many ounces of milk were there for Ha...
def solve() -> int: ella_milk = 3/5 * 64 ava_milk = 1/4 * ella_milk jacob_milk = 12 + ella_milk + ava_milk hannah_milk = 64 total_milk = ella_milk + ava_milk + jacob_milk + hannah_milk result = total_milk return result
If 45 people can lift a box of books with a weight of 25kg each, what is the total weight of the box of books that the 45 people can lift?
def solve() -> int: num_people = 45 weight_per_book = 25 result = num_people * weight_per_book return result
san bought a dress which cost her $89.50 after taxes. If the sales tax rate is 8%, what was the original price of the dress?
def solve() -> int: sale_price = 89.50 tax_percentage = 0.08 tax_amount = sale_price * tax_percentage original_price = sale_price - tax_amount result = original_price return result
Henry is hosting a book club meeting at his house. There will be seven people total and the meeting will last for three hours. Every hour each person will want to drink 1/4 a bottle of water. How many water bottles should Henry buy for the meeting?
def solve() -> int: num_people = 7 meeting_length = 3 water_per_person_per_hour = 1/4 total_water_needed = num_people * meeting_length * water_per_person_per_hour result = total_water_needed return result
Kylie earned $3000 from selling her paintings and decided to invest this money in the stock market. She spent 60% of her earnings on stock Y, 20% on stock Z, and 20% on stock AA. After one year, stock Y and Z had lost 10%, while stock AA had gained 50%. At the end of the year, how much were Kylie's stocks worth, in dol...
def solve() -> int: y = 0.6 * 3000 z = 0.2 * 3000 aa = 0.2 * 3000 y_final = y * 0.9 z_final = z * 0.9 aa_final = aa * 1.5 result = y_final + z_final + aa_final return result
If a rectangular plot of land has a length of 100 feet and a width of 80 feet, what is the area of the plot in square feet?
def solve() -> int: length = 100 width = 80 area = length * width result = area return result
A recipe for chocolate chip cookies calls for 2 cups of flour, 3/4 cup of sugar, 1/2 cup of butter, 1 egg, and 1/2 cup of chocolate chips. How many cups of flour are needed to make 3 batches of cookies?
def solve() -> int: flour = 2 * 3 / 1 result = flour return result
To motivate her students to learn a new language, a language teacher promises them a certificate if they pass a certain number of tests. The students need to pass 10 tests to win the certificate. Each time a student passes a test, the teacher gives them 3 points. There are 20 students in the class. If they have one mon...
def solve() -> int: num_tests_needed = 10 points_per_test = 3 num_students = 20 num_weeks = 4 total_points_needed = num_tests_needed * points_per_test * num_students tests_per_week = total_points_needed / (num_weeks * points_per_test) result = tests_per_week / num_students ...
A baby shower is being planned and a baker is making cupcakes for the occasion. The baker has 4 kg of sugar available and 3 kg of flour. If each batch of cupcakes requires 250 grams of sugar and 300 grams of flour, how many batch of cupcakes can the baker make with the ingredients available?
def solve() -> int: sugar_available = 4000 sugar_required = 250 flour_available = 3000 flour_required = 300 result = min(sugar_available // sugar_required, flour_available // flour_required) return result
If Mark spent 30% of his income on rent and 1/5 on transportation, what percentage of his income does he have left?
def solve() -> int: income = 2000 spent_on_rent = income * 0.3 spent_on_transportation = income * 1/5 leftover_percent = (income - (spent_on_rent + spent_on_transportation))/income * 100 result = leftover_percent return result
Carlos paints a picture with 20 colors. He uses 2 shades of blue and 4 times as many shades of red as blue. Then he uses one third as many shades of green as the blue and red shades combined. If the rest of the colors he uses are different shades of yellow, how many shades of yellow does he use?
def solve() -> int: red = 2 * 4 green = (2 + red) / 3 not_yellow = 2 + red + green yellow = 20 - not_yellow result = yellow return result
A grocery store charges $3 per pound of apples. If Jennifer bought 2.5 pounds of apples, how much did she spend?
def solve() -> int: total_cost = 3 * 2.5 result = f"Jennifer spent ${total_cost} on apples" return result
If a train travels 250 kilometers in one hour, then 350 kilometers half the amount the next hour, and 300 kilometers twice the amount the following hour, and the same 250 kilometers in the last hour, how much did the train travel in total in 4 hours?
def solve() -> int: total = 0 total = total + 250 total = total + (0.5*350) total = total + (2*300) total = total + 250 result = total return result
Question4: Tyler bought 9 times as many cards as Kyle. How many cards did Tyler buy if Kyle bought 72 cards?
def solve() -> int: kyle_cards = 72 tyler_cards = kyle_cards * 9 result = tyler_cards return result
There are 30 children in a class. If 25% of the children were absent, how many children were absent?
def solve() -> int: total_children = 30 absent_percentage = 25 absent_count = total_children * absent_percentage / 100 result = absent_count return result
A company has 2 types of products, product A and product B. They have 5 times as many units of product A as they do of product B, but product B is twice as expensive as product A. If the total value of both products together is $1500. How many units of product B does the company have?
def solve() -> int: b_units = 1500/(10/3) result = int(b_units/2) return result
Student: Bella drew a picture. The picture has an area of 36 cm². Her picture is in the shape of a square. What is the length of one side of the square?
def solve() -> int: area = 36 side_length = area ** 0.5 result = side_length return result
A factory produces 100 widgets per hour. How many widgets will be produced in 12 hours?
def solve() -> int: widgets_per_hr = 100 total_widgets_12hrs = widgets_per_hr * 12 result = total_widgets_12hrs return result
Student: A rectangle has a length of 20 centimeters and a perimeter of 70 centimeters. What is the width of the rectangle?
def solve() -> int: length = 20 perimeter = 70 width = (perimeter - 2 * length) / 2 result = width return result
A water tank can hold 2000 liters of water. If it is currently filled to 75% of its capacity, how many liters of water are in the tank?
def solve() -> int: tank_capacity = 2000 fill_percentage = 0.75 current_water_level = tank_capacity * fill_percentage result = current_water_level return result
A car travels at a speed of 60 miles per hour for 2 hours. How far did it travel?
def solve() -> int: speed = 60 time = 2 distance = speed * time result = distance return result
Student: A bookstore has 120 copies of a book on its shelves. Each month, the bookstore can sell 10% of its inventory. How many copies of the book can the bookstore sell in 5 months?
def solve() -> int: inventory = 120 percentage = 0.1 months = 5 copies_sold_each_month = inventory * percentage total_copies_sold = copies_sold_each_month * months result = total_copies_sold return result
A rectangle has a perimeter of 70 cm. If the width is 10 cm less than the length, find the length and width.
def solve() -> int: perimeter = 70 length = perimeter/2 - 5 width = length - 10 result = (length, width) return result
Tina has 60 books. She donates 35% of her books to the library. How many books does Tina have left? She then buys 25 more books. How many books does Tina have in the end?
def solve() -> int: books = 60 books_donated = books * 0.35 books_left = books - books_donated books_bought = books_left + 25 result = books_bought return result
A movie theater has 200 seats. If 80% of the seats are filled, how many seats are empty?
def solve() -> int: empty_seats = 0.2 * 200 result = empty_seats return result
Mia has $500 more than Nick. Nick has half the money that Liam has. If Liam has $1,200, how much money does Mia have?
def solve() -> int: liam_money = 1200 nick_money = liam_money / 2 mia_money = nick_money + 500 result = mia_money return result
A rectangle has a length of 6 cm and a width of 3 cm. What is the area of the rectangle?
def solve() -> int: length = 6 width = 3 area = length * width result = area return result
There are 120 students in a school, and the ratio of boys to girls is 2:3. How many girls are in the school?
def solve() -> int: boys_ratio = 2 girls_ratio = 3 total_ratio = boys_ratio + girls_ratio girls_count = 120 * girls_ratio / total_ratio result = girls_count return result
A factory produced 25 cans of soda in each crate. There are 10 crates on the truck. After delivering 8 crates to a store, how many cans of soda are left?
def solve() -> int: crates_on_truck = 10 cans_per_crate = 25 crates_delivered = 8 total_cans = crates_on_truck * cans_per_crate cans_left = total_cans - crates_delivered * cans_per_crate result = cans_left return result
Student: A store sells paint in tall containers each containing 4 cans. If there are 8 containers, how many cans are there?
def solve() -> int: containers = 8 cans_per_container = 4 cans = containers * cans_per_container result = cans return result
Vanessa owns a cupcake bakery. Today she made 60 cupcakes, which took her 2 minutes each to make. She also made 24 muffins, which took her 4 minutes each to make. How many minutes did Vanessa spend making the cupcakes and muffins?
def solve() -> int: cupcakes = 60 muffins= 24 time_to_make_cupcakes = cupcakes * 2 time_to_make_muffins = muffins * 4 total_time = time_to_make_cupcakes + time_to_make_muffins result = total_time return result
Student: Caroline is ordering balloons for her birthday party. Each package comes with 12 balloons. If she needs 50 balloons, how many packages should she order?
def solve() -> int: num_balloons = 50 num_per_package = 12 num_packages = num_balloons // num_per_package remaining_balloons = num_balloons % num_per_package result = num_packages return result
If Ava has 850 marbles and gives away 4/5 of them to her two friends, Jack and Ella, who share the marbles in a ratio of 3:2 respectively, how many marbles does Jack receive?
def solve() -> int: marbles = 850 jack_share_ratio = 3 ella_share_ratio = 2 total_share_ratio = jack_share_ratio + ella_share_ratio jack_share = (marbles * (jack_share_ratio / total_share_ratio)) * (4/5) result = jack_share return result
Jack has $60 to buy a new video game that costs $45. How much money will he have left after buying the game?
def solve() -> int: game_cost = 45 money_left = 60 - game_cost result = f"Jack will have ${money_left} left." return result
John drives from his home to the airport. During the first half of the drive, he drives at a speed of 50 miles per hour. During the second half of the drive, he drives at a speed of 60 miles per hour. If the whole drive takes 2 hours, what is the distance from John's home to the airport, in miles?
def solve() -> int: d = 2400/11 result = d return result
The Phoenix Suns and the Los Angeles Lakers played a basketball game where the Suns scored 110 points while the Lakers scored 100 points. In the remaining 2 minutes, the Lakers scored 2 two-point baskets and 1 three-point basket while the Suns scored only 1 three-point basket. Who won the game and by how many points?
def solve() -> int: suns_score = 110 lakers_score = 100 lakers_score += 2 * 2 + 1 * 3 suns_score += 1 * 3 if suns_score > lakers_score: winner = "Suns" difference = suns_score - lakers_score elif lakers_score > suns_score: winner = "Lakers" difference = ...
ome possible questions and programs are: Lisa fills a water bottle with 750 ml of juice and drinks 50 ml every 15 minutes. How much juice is left in the bottle after 2 hours?
def solve() -> int: juice = 750 rate = 50 time = 2 time = time * 60 drinks = time // 15 juice = juice - drinks * rate result = juice return result
-Note, if the question is unclear to you, please replace it with a different question that is more clear. Possible questions and programs: David has 12 apples and gives one-fourth of them to his friend. Then he eats 3 apples. How many apples does he have left?
def solve() -> int: apples = 12 apples_given = apples / 4 apples_left = apples - apples_given - 3 result = apples_left return result
A water tank can hold 1000 liters of water. If it is 40% full, how many liters of water are in the tank?
def solve() -> int: tank_capacity = 1000 tank_full_percentage = 40 water_in_tank = (tank_full_percentage / 100) * tank_capacity result = water_in_tank return result
A rectangular cake has a length of 40 centimeters and a width of 25 centimeters. Tom wants to cut the cake into equal pieces, each with an area of 100 square centimeters. How many pieces can he cut?
def solve() -> int: area_cake = 40 * 25 pieces = area_cake / 100 result = pieces return result
Dylan can eat three times more hot dogs than Tyler in a minute. If Dylan eats 60 hot dogs and Tyler eats at the same time half the number of hot dogs on smaller buns that are a quarter the size of the larger buns, how many hot dogs did Tyler eat?
def solve() -> int: dylan_hotdogs = 60 tyler_hotdogs = dylan_hotdogs / 3 tyler_buns = tyler_hotdogs / 2 smaller_buns = tyler_buns / 4 result = smaller_buns return result
A crate of oranges weighs 32 pounds. If each orange weighs 8 ounces, how many oranges are in the crate?
def solve() -> int: crate_weight = 32 * 16 orange_weight = 8 number_of_oranges = crate_weight / orange_weight result = number_of_oranges return result
A company's revenues increased from $100000 to $120000. What is the percentage increase in revenue?
def solve() -> int: initial_revenue = 100000 final_revenue = 120000 increase = final_revenue - initial_revenue percentage_increase = (increase/initial_revenue) * 100 result = percentage_increase return result
A rope is cut into two parts in a ratio of 3:4. If the longer piece is 20 feet longer than the shorter piece, what is the length of the longer piece?
def solve() -> int: total_length = 3 + 4 shorter_piece_length = 1 / total_length longer_piece_length = 1 - shorter_piece_length difference = 20 longer_piece = longer_piece_length * (total_length * difference) result = longer_piece return result
Sophie went to the pet store to buy some pet supplies. She bought 7 bags of cat food, 4 bags of dog food, 3 bags of hamster food, and a small bag of birdseed, which were all placed in a single paper bag. Unfortunately, the bag that the pet supplies had been placed in had developed a hole. Therefore, as Sophie walked ho...
def solve() -> int: cat_food = 7 dog_food = 4 hamster_food = 3 birdseed = 1 total_supplies = cat_food + dog_food + hamster_food + birdseed supplies_left = total_supplies / 2 hamster_food_left = supplies_left - (cat_food + dog_food + birdseed) result = hamster_food_left ...
Ryan bought 20% fewer oranges than his sister Emma while they were shopping, and Emma bought 6 more oranges than their friend Ava. If Ryan bought 200 oranges, how many oranges did all of them buy?
def solve() -> int: ryan_oranges = 200 emma_oranges = ryan_oranges / 0.8 ava_oranges = emma_oranges - 6 total_oranges = ryan_oranges + emma_oranges + ava_oranges result = total_oranges return result
A group of friends runs on a circular track that is 0.8 miles long every day. Julian runs twice as fast as his friend, Alex, and circles the track 4 times. During their workout, how many times does Alex circle the track?
def solve() -> int: track_length = 0.8 julian_speed = 2 julian_laps = 4 alex_speed = julian_speed / 2 alex_laps = julian_laps * (alex_speed / julian_speed) result = alex_laps return result
Lucas is a dog trainer and he gives his dogs 1/3 cup of kibble and 2 tablespoons of canned food for breakfast and dinner. If he has 6 dogs, how much food will he need for a week?
def solve() -> int: dogs = 6 kibble_per_meal = 1/3 canned_food_per_meal = 2 meals_per_day = 2 days_per_week = 7 kibble_per_week = dogs * kibble_per_meal * meals_per_day * days_per_week canned_food_per_week = dogs * canned_food_per_meal * meals_per_day * days_per_week total...
Michael has $90 to spend on a new soccer ball. He spends $25 on a ball and $20 on shin guards. If he has $35 left to spend on cleats, how much money did he have at first?
def solve() -> int: ball_cost = 25 shin_guard_cost = 20 cleats_cost = 35 total_money = ball_cost + shin_guard_cost + cleats_cost initial_money = total_money + 35 result = initial_money return result
A company's revenue for a quarter was $250,000. If the expenses were $187,500, what is the company's profit for the quarter?
def solve() -> int: profit = 250000 - 187500 result = profit return result
A recipe calls for 2/3 cup of sugar, but you only have a 1/4 measuring cup. How many times do you need to fill the measuring cup to get the required amount of sugar?
def solve() -> int: required_amount = 2/3 measure_cup = 1/4 num_fills = required_amount/measure_cup result = num_fills return result
Bob has 20 stickers and he wants to trade them with Alice. Alice has 15 stickers and she wants to trade them with Bob. They agree to trade two stickers of Bob for three stickers of Alice. How many stickers will each of them have after the trade?
def solve() -> int: bob = 20 alice = 15 ratio = 2 / 3 trade = 6 bob = bob - trade + trade * ratio alice = alice - trade * ratio + trade result = (bob, alice) return result
A book publisher is printing a new book. They need a combination of ink and paper to create the pages. Each cartridge of ink requires twice as many reams of paper as it does cartridges of ink to make. Each book requires 2 cartridges of ink. The company printed 50 pages on one day, then 20 more than double that on the s...
def solve() -> int: ink_per_page = 2/50 pages_day1 = 50 pages_day2 = 20 + 2*50 total_pages = pages_day1 + pages_day2 remaining_pages = 300 - total_pages reams_per_ink = 2 ink_needed = remaining_pages * ink_per_page / reams_per_ink result = ink_needed ...
Ayesha bought a pair of jeans for $29.99 and a sweater for $34.99. She had a $10 off coupon that she could use on one item. She decided to use it on the more expensive item. She also had to pay 13% sales tax on her purchase. How much did Ayesha pay in total?
def solve() -> int: sweater_price = 34.99 - 10 subtotal = 29.99 + sweater_price sales_tax = subtotal * 0.13 total = subtotal + sales_tax total = round(total, 2) result = total return result
Possible questions and programs: At the Smith Farm, there are 395 pumpkins, 823 apples, and 276 corns. How many fruits and vegetables are at the Smith Farm in total?
def solve() -> int: result = 395 + 823 + 276 return result
Alex has $450 in his bank account. He spends $30 every week. How many weeks will it take Alex to spend all his money?
def solve() -> int: bank_account = 450 weekly_spending = 30 weeks = bank_account // weekly_spending result = weeks return result
A box of pens cost $18. If each pen costs $0.75, how many pens are in the box?
def solve() -> int: cost_of_box = 18 cost_per_pen = 0.75 pens_in_box = cost_of_box / cost_per_pen result = pens_in_box return result
If you have 15 apples and want to divide them equally among 3 people, how many apples does each person get?
def solve() -> int: apples = 15 people = 3 apples_per_person = apples / people result = apples_per_person return result
Student: John has five more baseballs than Frank. If Frank has 13 baseballs, how many baseballs does John have?
def solve() -> int: frank_baseballs = 13 john_baseballs = frank_baseballs + 5 result = john_baseballs return result
Paul is creating a rooftop garden that is 25 feet long and 12 feet wide and wants to make raised beds along the entire perimeter of the garden. If each raised bed uses 1 foot of space along the perimeter, how many raised beds will there be?
def solve() -> int: length = 25 width = 12 perimeter = (length * 2) + (width * 2) raised_bed_number = perimeter / 1 result = raised_bed_number return result
Anne bought 11 shirts, 4 sweaters and 9 sandals that cost $15 each, $30 each and $25 each respectively. She spent an additional $4 on shipping. If Anne had a total of $285 initially, how much money does she have now?
def solve() -> int: total_cost = 15*11 + 30*4 + 25*9 + 4 result = 285 - total_cost return result
At a clothing store, there are 60 different articles of clothing to try on. The store features shirts in a third of its clothing, pants in a quarter of its clothing, and belts in three of the articles of clothing. Alex doesn't like belts and won't wear them, but can avoid them in one of the pants that he would be willi...
def solve() -> int: total_clothing = 60 shirts = total_clothing / 3 pants = total_clothing / 4 belts = 3 pants_without_belts = pants - 1 articles_to_try_on = shirts + pants_without_belts result = articles_to_try_on return result
A bag of candy costs $4.50. If Emily has $12 and wants to buy as many bags of candy as she can with her money, how many bags can she buy?
def solve() -> int: money_on_hand = 12 cost_per_bag = 4.5 num_bags_can_buy = money_on_hand // cost_per_bag result = num_bags_can_buy return result
If John scored 24 free throws worth 5 points each and 15 field goals worth 4 points, how many points did he score in total?
def solve() -> int: free_throw = 24 * 5 field_goal = 15 * 4 result = free_throw + field_goal return result
Anna wants to make lemonade with all her lemons. It takes four times as much water as lemons. If she has 8 lemons, how much water does she need to make the lemonade?
def solve() -> int: lemons = 8 water = lemons * 4 result = water return result
A supermarket has arranged the layout of its aisles. There are 5 rows of fruit stands in a line and behind each row are 3 rows of vegetable stands. There are four times as many flower stands as vegetable stands throughout the supermarket. The fruit stands have 16 apples each, the vegetable stands have 8 tomatoes each a...
def solve() -> int: fruit_stands = 5 vegetable_stands = 15 flower_stands = 60 apples_per_stand = 16 tomatoes_per_stand = 8 roses_per_stand = 12 total_apples = fruit_stands * apples_per_stand total_tomatoes = vegetable_stands * tomatoes_per_stand total_roses = flower_stands ...
John has 9 bars of chocolate. He befriended 3 kids and decided to give them each the same amount of chocolate. How much chocolate does each kid get?
def solve() -> int: total_bars = 9 num_kids = 3 bars_each_kid = total_bars / num_kids result = bars_each_kid return result
The average score of a student in 5 tests is 85. If the total of the first 4 tests is 340, what is the score of the student in the fifth test?
def solve() -> int: average = 85 total_first_4_tests = 340 total_all_5_tests = 5 * average score_in_fifth_test = total_all_5_tests - total_first_4_tests result = score_in_fifth_test return result
A bookstore is going out of business and needs to sell all of its books. They offer a 60% discount on books which normally retail for $15 each. They sell 85% of the books. If they owed $8,000 to their creditors, how much money do they have left after paying off their debt?
def solve() -> int: retail_price = 15 discount = 0.6 sale_price = retail_price * (1 - discount) books_sold = 0.85 total_sales = sale_price * books_sold * 1000 amount_owed = 8000 money_left = total_sales - amount_owed result = money_left return result
There are twice as many dogs as there are cats in a pet store. If the total number of cats and dogs is 21, how many cats are in the pet store?
def solve() -> int: total_pets = 21 dogs = total_pets / 3 * 2 cats = total_pets - dogs result = cats return result
If Mike had 5 quarters, 7 dimes, and 6 nickels, how much money did he have in cents?
def solve() -> int: quarters = 5 dimes = 7 nickels = 6 quarter_value = quarters * 25 dime_value = dimes * 10 nickel_value = nickels * 5 result = quarter_value + dime_value + nickel_value return result