question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
ally planted 3 rows of strawberries. In each row, she planted 8 strawberry plants. How many strawberry plants did she plant in total?
def solve() -> int: rows = 3 strawberry_plants = 8 result = rows * strawberry_plants return result
Tommy's family went out to dinner and bought 4 burgers for $5 each, a pizza for $20, 2 sides for $3 each, and 4 drinks for $2.50 each. What was the total cost of dinner?
def solve() -> int: cost_burgers = 4 * 5 cost_pizza = 20 cost_sides = 2 * 3 cost_drinks = 4 * 2.50 total_cost = cost_burgers + cost_pizza + cost_sides + cost_drinks result = total_cost return result
Sarah and Jake are studying for a physics exam. Sarah has scored 75 out of 100 points on a practice test and Jake has scored 68 points. If Jake gets an additional 10 points, how many more points does Sarah need to have a higher test score?
def solve() -> int: sarah_score = 75 jake_score = 68 jake_score += 10 score_difference = sarah_score - jake_score result = score_difference return result
Student: Jack and Jill worked together to paint a room. With each bucket of paint that they used, Jack was able to paint three times the amount of walls that Jill could paint. If the room they painted was 16 walls total, how many walls did Jill paint?
def solve() -> int: total_walls = 16 jack_walls = 0 jill_walls = 0 jack_walls = total_walls - jill_walls jill_walls = jack_walls / 3 result = jill_walls return result
If 4 bags of chips cost $14 and each bag contains 6 chips, how much does one chip cost?
def solve() -> int: total_cost = 14 total_chips = 6 * 4 cost_of_one_chip = total_cost / total_chips result = cost_of_one_chip return result
A bag has 100 marbles, 25% of them are green, 10% are pink and the rest are blue. How many blue marbles are there?
def solve() -> int: green_marbles = 100 * 0.25 pink_marbles = 100 * 0.10 blue_marbles = 100 - green_marbles - pink_marbles result = blue_marbles return result
Student: A train travels 300 miles in 5 hours. What is the average speed of the train in miles per hour?
def solve() -> int: distance = 300 time = 5 speed = distance / time result = speed return result
san is building a play area for her kids. A 300 square foot slide module costs $15,000, a 200 square foot swing module costs $10,000, and a 100 square foot sand module costs $4,000. All other modules cost $50 per square foot. If Susan plans to build an 800 square foot play area containing one slide, one swing, and one ...
def solve() -> int: slide_module = 15000 swing_module = 10000 sand_module = 4000 total_sqft = 800 other_sqft = total_sqft - (300 + 200 + 100) other_cost = other_sqft * 50 result = slide_module + swing_module + sand_module + other_cost return result
A bar of chocolate has a mass of 225 grams. If a recipe calls for 1/4 of the bar, how much chocolate is needed?
def solve() -> int: mass_of_chocolate = 225 portion_needed = 1/4 amount_needed = mass_of_chocolate * portion_needed result = amount_needed return result
Peter's uncle is a poultry farmer who delivers chicken to the local market. On a Sunday morning, his uncle assigns Peter to get 30 chickens for sale from their farm. While moving the chickens, Peter mistakenly drops six of them. His uncle then instructs him to add 18 more chickens for sale. How many chickens were sold ...
def solve() -> int: chickens_initial = 30 chickens_dropped = 6 chickens_added = 18 chickens_remaining = chickens_initial - chickens_dropped chickens_sold = chickens_remaining + chickens_added result = chickens_sold return result
Possible additional questions are: Oscar has $200. He spends one-fourth on a video game and the rest on books. If each book costs $15, how many books does Oscar buy?
def solve() -> int: books_spent = 200 - 200 / 4 books_bought = books_spent / 15 result = books_bought return result
In a classroom of 25 students, there are 10 boys. If each boy shares his chocolate bar with 3 girls, how many students end up with chocolate?
def solve() -> int: boys = 10 girls = 25 - boys total_chocolate = boys for i in range(boys): total_chocolate += 3 result = total_chocolate return result
Olivia jogged for 40 minutes at a pace of 8 kilometers per hour. How far did she run?
def solve() -> int: time = 40 pace = 8 time_hours = time / 60 distance = pace * time_hours result = distance return result
If a store has a 10% off sale and an item is originally priced at $50, what is the new price?
def solve() -> int: original_price = 50 discount = 0.10 new_price = original_price - (original_price * discount) result = new_price return result
A triangle has a base of 10 cm and a height of 6 cm. What is the area of the triangle in square centimeters?
def solve() -> int: base = 10 height = 6 area = 0.5 * base * height result = area return result
A train travels at a constant speed of 60 km/h. It takes 2 hours to travel from station A to station B. It then stops at station B for 15 minutes before continuing to station C. It takes another 1.5 hours to travel from station B to station C. What is the total distance between station A and station C in kilometers?
def solve() -> int: distance_AB = 60 * 2 distance_BC = 60 * 1.5 total_distance = distance_AB + distance_BC result = total_distance return result
At a pet store, there are 600 cats. A fifth of the cats are Siamese. Of the Siamese cats, half of them are male. Of the male Siamese, a third of them have blue eyes. How many male Siamese cats have blue eyes?
def solve() -> int: cats = 600 siamese_cats = cats / 5 male_siamese_cats = siamese_cats / 2 blue_eyed_male_siamese_cats = male_siamese_cats / 3 result = blue_eyed_male_siamese_cats return result
A car rental company charges a flat fee of $60 plus $0.25 per mile driven. If you rent a car and drive 100 miles, how much will you have to pay?
def solve() -> int: flat_fee = 60 mileage_fee = 0.25 miles_driven = 100 total_cost = flat_fee + mileage_fee * miles_driven result = total_cost return result
Alex has a fishing boat where he can catch 30 crabs every day and sell them for $8 each. He can also catch 20 lobsters and sell them for $12 each. How much money can Alex earn every week?
def solve() -> int: crabs_per_day = 30 crab_price = 8 lobsters_per_day = 20 lobster_price = 12 crabs_per_week = crabs_per_day * 7 lobsters_per_week = lobsters_per_day * 7 crab_earnings = crabs_per_week * crab_price lobster_earnings = lobsters_per_week * lobster_price t...
A store sells 200 pairs of shoes every month at $50 per pair. The store owner wants to raise the price by 20%. How much revenue will the store make every month with the price raise?
def solve() -> int: pairs_of_shoes = 200 price_per_pair_before = 50 price_per_pair_after = price_per_pair_before * 1.2 revenue_before = pairs_of_shoes * price_per_pair_before revenue_after = pairs_of_shoes * price_per_pair_after result = revenue_after return result
Tom caught 15 fish in the lake. He threw back a third of them and kept two for his dinner. How many fish did he throw back into the lake?
def solve() -> int: fish_caught = 15 fish_kept = 2 fish_thrown_back = fish_caught - fish_kept result = fish_thrown_back return result
Holly drives at an average speed of 60km/h. She starts from her home at 8am in the morning and drove for 10 hours. How far did she get?
def solve() -> int: average_speed = 60 hours_driven = 10 distance = average_speed * hours_driven result = distance return result
Student: Sarah built a right triangle patio. The length of the two sides other than the hypotenuse were equal. If the area of the triangle was 100 squrae feet, what was the length of each of the two sides, in feet?
def solve() -> int: area = 100 hypotenuse = (area * 2) ** 0.5 side_length = hypotenuse / 2 result = side_length return result
A sports store gives a discount of 15% on all its merchandise. If the original price of a basketball is $50, how much will it cost after the discount is applied?
def solve() -> int: price = 50 discount_rate = 0.15 discount_amount = price * discount_rate discounted_price = price - discount_amount result = discounted_price return result
Khloe currently pays $10 for an Uber ride. She notices that Uber is offering a subscription service that costs $12 a month. In a year, how much money will she have saved if she gets the subscription?
def solve() -> int: months = 12 old_cost = 10 new_cost = 12 old_cost_year = months*old_cost saving = old_cost_year - new_cost result = saving return result
A pizza has 8 slices. If each slice has 100 calories, and Jane ate 2 slices, her brother ate 3 slices, and her mother ate 1 slice, how many calories did they eat altogether?
def solve() -> int: slices = 2+3+1 calories = slices*100 result = calories return result
A rectangular yard measures 25 feet in length by 15 feet in width. If 40% of the yard is paved with concrete, how many square feet are paved?
def solve() -> int: length = 25 width = 15 total_area = length * width paved_percent = 40 paved_area = (paved_percent/100)*total_area result = paved_area return result
If there are 20 horses and 50 cows, and 10 of the horses and 30 of the cows are pregnant, how many more pregnant horses than cows are there?
def solve() -> int: horses = 20 pregnant_horses = 10 cows = 50 pregnant_cows = 30 result = pregnant_horses - pregnant_cows return result
A catering company makes 3 different types of sandwiches for a lunch event. The first type has 4 pieces of bread, 2 slices of cheese, and 3 oz. of turkey per sandwich. The second type has 2 pieces of bread, 1 slice of cheese, and 2 oz. of ham per sandwich. The third type has 2 pieces of bread, 1 slice of cheese, and 3 ...
def solve() -> int: type1_bread = 4 type1_cheese = 2 type1_turkey = 3 type2_bread = 2 type2_cheese = 1 type2_ham = 2 type3_bread = 2 type3_cheese = 1 type3_beef = 3 type1_sandwiches = 120 type2_sandwiches = 80 type3_sandwiches = 60 total_cheese = (...
Mia has a plate with 10 rows of fruits. Each row has 15 fruits. She sets aside 4 rows of 8 fruits in the middle of the plate with oranges. She sets aside all fruits on the first 2 and last 2 rows with apples. Then she sets aside the rest with bananas. How many fruits does Mia set aside with bananas?
def solve() -> int: rows_of_fruits = 10 fruits_per_row = 15 rows_of_oranges = 4 fruits_per_orange_row = 8 rows_of_apples = 2 rows_of_bananas = rows_of_fruits - rows_of_oranges - rows_of_apples fruits_set_aside_with_apples = rows_of_apples * fruits_per_row fruits_set_aside_...
A bookstore sells textbooks for $100 each, but offers a 25% discount during the first week of classes. If a student buys 4 textbooks during the discount period, how much will they spend?
def solve() -> int: price = 100 discount = 0.25 num_books = 4 subtotal = (1 - discount) * price * num_books result = f'<<<{subtotal}>>>' result = subtotal return result
Ben has 12 blue marbles and 8 red marbles in a jar. He takes out some marbles at random and puts them in a box. The box has 15 marbles in total and 9 of them are blue. How many marbles are left in the jar?
def solve() -> int: jar_total = 12 + 8 blue_taken = 9 red_taken = 15 - 9 blue_left = 12 - blue_taken red_left = 8 - red_taken jar_left = blue_left + red_left result = jar_left return result
Troy takes the train to work every day from Monday to Friday. Each trip takes him 25 minutes. How many minutes of his precious time does Troy spend on the train in a week?
def solve() -> int: num_trips_per_week = 5 duration_one_trip = 25 result = num_trips_per_week * duration_one_trip print (result) return result
Student: Lisa is planning a trip to the zoo with her friends and wants to know how much money she will spend on tickets and food. The zoo charges $12 for an adult ticket and $8 for a child ticket. Lisa is 16 years old and her friends are 15, 17, and 14 years old. They also want to buy snacks and drinks at the zoo, whic...
def solve() -> int: adult_ticket_cost = 12 child_ticket_cost = 8 snacks_cost = 5 lisa_age = 16 friend1_age = 15 friend2_age = 17 friend3_age = 14 total_ticket_cost = adult_ticket_cost + child_ticket_cost * 3 total_snacks_cost = snacks_cost * 4 total_cost = total_ticket_cost + tot...
Nine times the value of a watch plus the difference between the original price of the watch and the sale price is equal to 2,250. If the watch was originally priced at $300 and is now on sale for $150, what is the value of the watch?
def solve() -> int: original_price = 300 sale_price = 150 difference = original_price - sale_price value = (2250 - difference) / 9 result = value return result
Tom and Jerry need to wash a car. Tom can wash the car in 20 minutes and Jerry can wash the car in 30 minutes. How long would it take for them to finish if they washed the car together?
def solve() -> int: tom_time = 20 jerry_time = 30 tom_rate = 1 / tom_time jerry_rate = 1 / jerry_time together_rate = tom_rate + jerry_rate together_time = 1 / together_rate result = together_time return result
If an employee gets a pay raise of 5% and their new salary is $42,000, what was their salary before the pay raise?
def solve() -> int: new_salary = 42000 pay_raise = 0.05 old_salary = new_salary / (1 + pay_raise) result = old_salary return result
Michaela wants to buy clay to use for modeling. She needs 600g of white clay and 400g of red clay. How many grams of clay does Michaela need to buy in total?
def solve() -> int: white = 600 red = 400 total = white + red result = total return result
Emily saw 2 dogs and 3 times as many cats as dogs while walking in the park. She also saw half as many rabbits as cats and 3 more than twice as many birds as dogs. How many animals did Emily see in total?
def solve() -> int: dogs = 2 cats = dogs * 3 rabbits = cats / 2 birds = 2 * dogs + 3 total_animals = dogs + cats + rabbits + birds result = total_animals return result
Student: Liam has 3 guinea pigs, 2 rabbits, and 1 ferret. He gives the guinea pigs a treat every day, the rabbits a treat every 2 days, and the ferret a treat every 3 days. In a year, how many treats does he give?
def solve() -> int: guinea_pigs = 3 rabbits = 2 ferrets = 1 gp_treats_per_day = 1 r_treats_per_day = 1/2 f_treats_per_day = 1/3 days_in_year = 365 gp_treats_in_year = guinea_pigs * gp_treats_per_day * days_in_year r_treats_in_year = rabbits * r_treats_per_day * days_in_year f_tre...
Susan swam for 4 hours at a rate of 2 miles per hour. How much more time would she need to cover 18 more miles at the same speed?
def solve() -> int: swim_time = 4 swim_rate = 2 distance_left = 18 distance_covered = swim_time * swim_rate remaining_distance = distance_left - distance_covered time_needed = remaining_distance / swim_rate result = time_needed return result
Each book needs to be edited in 2 hours. Each editor needs to edit 5 books per day. Each publisher needs to approve 2 editors' work per day. How many hours get spent editing per day if there are 4 publishers?
def solve() -> int: books_per_editor = 5 editors_per_publisher = 2 hours_per_book = 2 publishers = 4 books_per_day = books_per_editor * editors_per_publisher * publishers hours_per_day = books_per_day * hours_per_book result = hours_per_day return result
Luisa has 15 acres of land and wants to divide it equally among her five goats. How much land will each goat receive?
def solve() -> int: acres_of_land = 15 number_of_goats = 5 land_per_goat = acres_of_land / number_of_goats result = land_per_goat return result
Student: A box contains 24 packets of tea. Each packet contains 4 tea bags. How many tea bags are in the box?
def solve() -> int: box = 24 packet = 4 total = box * packet result = total return result
A group of friends went to a restaurant and the bill came out to be $128. If they split the bill evenly, how much does each person have to pay if there are 6 people in the group?
def solve() -> int: bill = 128 num_people = 6 per_person = bill/num_people result = per_person return result
A farmer has a rectangular field that measures 60 meters by 40 meters. He decides to divide the field into four equal parts by fencing along the diagonal. He also fences around the entire field. How many meters of fencing does he need in total?
def solve() -> int: a = 60 b = 40 c = (a**2 + b**2)**0.5 total = 2 * (a + b) + 2 * c result = total return result
A train covered the first 25% of its distance at a speed of 60 km/h. Next 25% of the distance is covered at a speed of 80 km/h. The remaining distance is covered at a speed of 90 km/h. What is the average speed of the train for the entire journey?
def solve() -> int: distance_covered = 100 s1, s2, s3 = 60, 80, 90 d1, d2, d3 = 25, 25, 50 time1 = d1 / s1 time2 = d2 / s2 time3 = d3 / s3 average_speed = distance_covered / (time1 + time2 + time3) result = average_speed return result
Jane has a jar of 200 marbles. She gives away 8 marbles on Monday, 12 marbles on Tuesday, and 10 marbles on Wednesday. How many marbles does Jane have left?
def solve() -> int: marbles = 200 marbles_monday = 8 marbles_tuesday = 12 marbles_wednesday = 10 marbles_left = marbles - marbles_monday - marbles_tuesday - marbles_wednesday result = marbles_left return result
A storage area measures 10 meters by 15 meters. If each storage unit measures 5 meters by 5 meters, how many storage units can the area accommodate?
def solve() -> int: area_length = 10 area_width = 15 unit_length = 5 unit_width = 5 unit_area = unit_length * unit_width area_area = area_length * area_width num_of_units = area_area // unit_area result = num_of_units return result
A store is having a sale where everything is 20% off. If a shirt originally costs $25, what is the new sale price?
def solve() -> int: price = 25 discount = price * 0.2 sale_price = price - discount result = sale_price return result
Jill has 5 more pens than Jack. If Jack has 10 pens, how many pens do they have altogether?
def solve() -> int: Jack = 10 Jill = Jack + 5 result = Jack + Jill return result
A triangle has a base of 12 cm and the height is twice the base. What is the area of the triangle?
def solve() -> int: area = (1/2) * 12 * (2 * 12) result = area return result
A gym membership costs $100 a month. If you pay for 6 months in advance you get a 10% discount. How much do you have to pay if you want to subscribe for 6 months?
def solve() -> int: monthly_price = 100 discount = 0.1 months = 6 discounted_price = monthly_price * months * (1 - discount) result = discounted_price return result
A square has a perimeter of 40 cm. What is the length of one of its sides?
def solve() -> int: perimeter = 40 side_length = perimeter/4 result = side_length return result
A pizza needs to be cut in 8 equal pieces and two additional pieces for the chef and waiter. How many pieces in total will be cut out of the pizza?
def solve() -> int: pieces = 8 additional_pieces = 2 result = pieces + additional_pieces return result
A recipe calls for 2 cups of flour and 3 eggs to make 12 pancakes. How much flour and eggs are needed to make 20 pancakes?
def solve() -> int: flour_per_pancake = 2/12 eggs_per_pancake = 3/12 num_pancakes = 20 flour_needed = flour_per_pancake * num_pancakes eggs_needed = eggs_per_pancake * num_pancakes result = (flour_needed, eggs_needed) return result
A marathon is 26.2 miles long. If a runner completes the marathon in 4 hours and 30 minutes, what was their average speed in miles per hour?
def solve() -> int: total_miles = 26.2 total_time_in_hours = 4.5 average_speed = total_miles / total_time_in_hours result = average_speed return result
Ethan goes grocery shopping with $90. He spends $22 on meat, $9 less on vegetables, and 20% of the cost of the vegetables on fruit. How much money does he have left?
def solve() -> int: money = 90 meat_cost = 22 vegetable_cost = meat_cost - 9 fruit_cost = 0.2 * vegetable_cost total_cost = meat_cost + vegetable_cost + fruit_cost money_left = money - total_cost result = money_left return result
A bike being sold at $150 is $20 more expensive than a bike being sold at the store. If you buy the store bike and a lock for $160, how much will you spend to buy the other bike and its lock?
def solve() -> int: store_bike = 160 other_bike = store_bike + 20 lock = 25 total_cost = other_bike + lock result = total_cost return result
Student: A factory produces 882 bottles a day with 15% of them are defective. How many bottles are produced without defects in one day?
def solve() -> int: bottles_produced = 882 percent_defective = 0.15 bottles_without_defects = bottles_produced * (1 - percent_defective) result = bottles_without_defects return result
Mike spent half of his money on a book and a quarter of the remaining on a toy. If he has $24 left now, how much did he have before buying the book?
def solve() -> int: money = 24 toy_spending = money / 4 remaining_money = money + toy_spending initial_money = remaining_money * 2 result = initial_money return result
Anna has 12 toy cars. She gave 1/3 of her toy cars to her brother. How many cars did her brother get?
def solve() -> int: cars_brother = 1/3 * 12 result = cars_brother return result
Student: A grocery store sold 80 cans of soda for $1 each and 150 loaves of bread for $2 each. The money from their sales was used to buy a total of 5 bags of flour that cost $20 each and 400 eggs that cost $0.20 each. How many bags of flour did they buy?
def solve() -> int: cans_of_soda = 80 loaves_of_bread = 150 cost_of_flour = 20 cost_of_eggs = 0.20 total_sales = cans_of_soda + loaves_of_bread * 2 total_cost = cost_of_flour * 5 + cost_of_eggs * 400 bags_of_flour = total_cost // cost_of_flour result = bags_of_flour return result
A group of people wants to hire a personal shopper to assist them in selecting clothes for their wardrobe. The shopper was previously paid $25 per hour, but they offer her a 20% raise. If they book her for an 8-hour shift, how much will each person have to pay?
def solve() -> int: hourly_rate = 25 raise_percentage = 20 shift_hours = 8 raise_amount = hourly_rate * raise_percentage / 100 new_hourly_rate = hourly_rate + raise_amount total_cost = new_hourly_rate * shift_hours result = total_cost return result
Bridgette is a travel agent. Her agency offers 3 tour packages to Rome, 6 tour packages to Paris, and 9 tour packages to London. If each London package can accommodate 20 people, which is double the capacity of the Paris packages, and each Rome package can accommodate 3 times as much as the Paris packages, how many peo...
def solve() -> int: rome_packages = 3 paris_packages = 6 london_packages = 9 london_capacity = 20 paris_capacity = london_capacity / 2 rome_capacity = paris_capacity * 3 total_capacity = (rome_packages * rome_capacity) + (paris_packages * paris_capacity) + (london_packages * london...
Mrs. Johnson has 120 dogs. 35% of the dogs are puppies, and the rest are adult dogs. Only 70% of the adult dogs can bark. How many dogs can't bark?
def solve() -> int: dogs = 120 puppies = dogs * 0.35 adult_dogs = dogs - puppies barking_dogs = adult_dogs * 0.70 non_barking_dogs = adult_dogs - barking_dogs result = non_barking_dogs return result
After a day of running, Lisa wants to count how many laps she did. For each mile, she ran 4 laps. If she ran 3 miles, how many laps did she do in total?
def solve() -> int: miles = 3 laps_per_mile = 4 total_laps = miles * laps_per_mile result = total_laps return result
Max has 35 birds and 8 times as many feathers as birds. Each bird has an average weight of 40 grams and each feather has an average weight of 0.3 gram. What is the total weight of all his pets?
def solve() -> int: birds = 35 feathers = 8*birds bird_weight = 40 feather_weight = 0.3 total_weight = (birds * bird_weight) + (feathers * feather_weight) result = total_weight return result
Adam can carry a box of books up a flight of stairs in 4 minutes while his friend Brayden can carry the same box of books up the same flight of stairs in 6 minutes. If they carry the box together, how much time can they save?
def solve() -> int: time_for_Adam = 4 time_for_Brayden = 6 time_saved = time_for_Adam + time_for_Brayden - 5 result = time_saved return result
Dean bought 5 packs of chips for $12. If each pack originally costs $3, what was the discount percentage Dean received?
def solve() -> int: original_price = 3 total_price = 12 discount_percent = (1 - (total_price/(5*original_price)))*100 result = discount_percent return result
A piece of paper is folded in half, and then folded in half again. If the paper started out as 8 inches by 11 inches, what are the dimensions of the paper after being folded twice?
def solve() -> int: initial_length = 11 initial_width = 8 after_first_fold_length = initial_length / 2 after_first_fold_width = initial_width after_second_fold_length = after_first_fold_width / 2 after_second_fold_width = after_first_fold_length result = (after_second_fold_length, after_seco...
Brian planned to run for two hours in the park. If he ends up only running for half of that time, and he runs a mile every ten minutes, how many miles did he run in that time?
def solve() -> int: total_time = 2 actual_time = total_time / 2 intervals = actual_time * 6 distance = intervals * 1 result = distance return result
Student: Eric wants to buy 24 apples and 5 oranges. How much would it cost if each apple costs $2 and each orange costs $0.5?
def solve() -> int: apples = 24 oranges = 5 apple_cost = 2 orange_cost = 0.5 total_cost = apples * apple_cost + oranges * orange_cost result = total_cost return result
A pets basket has 5 hamsters, 9 fish, 3 rabbits, 2 turtles, and a bag of pet food. Each hamster costs $8, each fish costs $3, 10 rabbits cost $50, each turtle costs $15, and a quarter of the bag of pet food costs $2. How much is the total cost of the pets basket?
def solve() -> int: hamsters = 5 fish = 9 rabbits = 3 turtles = 2 pet_food = 1 hamsters_cost = hamsters * 8 fish_cost = fish * 3 rabbits_cost = (10/3) * 50 turtles_cost = turtles * 15 pet_food_cost = (1/4) * pet_food * 2 total_cost = hamsters_cost + fish_cost + rabb...
A company has 200 employees, of which 40% are women and 25% of the men are in management positions. If the number of women in the management positions is 15, how many men are in the company?
def solve() -> int: total_employees = 200 women_ratio = 0.40 men_ratio = 1 - women_ratio management_ratio_of_men = 0.25 women_in_management = 15 women_in_company = women_ratio * total_employees men_in_company = total_employees - women_in_company men_in_management = (women_in_management /...
A pizza place charges $10 for a small pizza, $15 for a medium pizza and $20 for a large pizza. If Sarah bought 1 small pizza, 2 medium pizzas and 1 large pizza, how much did she have to pay?
def solve() -> int: small_pizza_price = 10 medium_pizza_price = 15 large_pizza_price = 20 number_of_small_pizzas = 1 number_of_medium_pizzas = 2 number_of_large_pizzas = 1 price_of_small_pizzas = small_pizza_price * number_of_small_pizzas price_of_medium_pizzas = medium_pizza_price * num...
A train is travelling at 60 miles per hour for 3 hours. It then slows down to 45 miles per hour for the next 2 hours. What is the total distance travelled by the train?
def solve() -> int: distance = 60*3 distance += 45*2 result = distance return result
In a book, one fifth of the total pages contains text and the rest are blank pages. If the total number of pages is 80, how many pages contain text?
def solve() -> int: total = 80 num_text = total / 5 num_blank = total - num_text result = num_text return result
Lisa's grandmother can walk the distance from her house to the park in 20 minutes. She covers 2/5 of the journey at a speed of 6 miles per hour and the rest at a pace of 4 miles per hour. If Lisa can walk at 3 miles per hour, how long will it take her to walk to the park?
def solve() -> int: distance = 1 time1 = (2/5) * distance / 6 time2 = (3/5) * distance / 4 total_time = time1 + time2 result = total_time * 60 return result
A car traveled 300 kilometers in 4 hours and used 20 liters of gas. The driver still had 200 kilometers to go and 10 liters of gas left. How many kilometers can the driver go with the remaining gas if the car's fuel efficiency stays the same?
def solve() -> int: distance = 300 time = 4 gas = 20 remaining_distance = 200 remaining_gas = 10 efficiency = distance / gas distance_with_remaining_gas = efficiency * remaining_gas result = distance_with_remaining_gas return result
In 2007, there were some cars in a parking lot. In 2008, one-eighth the number of cars were taken out of the parking lot as compared to 200Emma bought a new phone for 350 dollars. It had a screen protector for 15 dollars and a phone case for 25 dollars. If the sales tax was 8%, what was the total cost of the phone?
def solve() -> int: cars_2007 = 100 cars_2008 = cars_2007 * 7/8 total_cost = 350 + 15 + 25 sales_tax = total_cost * 0.08 result = total_cost + sales_tax return result
A bottle of juice contains 750 ml of liquid. How many glasses of 150 ml can be filled from the bottle?
def solve() -> int: glasses = 750 / 150 result = glasses return result
A student received a score that was 20 less than three times their friend's score. If their friend's score was 80, what was the student's score?
def solve() -> int: friend_score = 80 student_score = (3*friend_score) - 20 result = student_score return result
Possible new questions and programs: A soccer team has 18 players and a coach. Each player has a jersey number from 1 to 18, and the coach has a jersey number of 0. The team scores a total of 27 goals in a tournament, and each goal is scored by a different player. What is the sum of the jersey numbers of the goal score...
def solve() -> int: sum = 0 for number in range(1, 19): sum = sum + number sum = sum - 0 result = sum return result
A school has 5 classes with 20 students in each class. If each student gets a textbook that costs $10, how much money is needed to buy the textbooks for everyone in the school?
def solve() -> int: num_classes = 5 students_per_class = 20 book_cost = 10 total_students = num_classes * students_per_class total_cost = total_students * book_cost result = total_cost return result
Student: Q7: In a club, there are 68 members and the ticket price for the gathering was $10. If each of them paid the ticket price, how much money was collected?
def solve() -> int: members = 68 ticket_price = 10 total_amount = members * ticket_price result = total_amount return result
Here are some possible questions and their corresponding programs: Based on a survey, children 8-12 years old read 15 pages of books each day. How many books can these children finish in 3 months if each book has 150 pages and they read 5 days a week?
def solve() -> int: pages_per_day = 15 book_pages = 150 days_per_week = 5 months = 3 weeks = months * 4 days = weeks * days_per_week pages = days * pages_per_day books = pages // book_pages result = books return result
Student: Sam is a carpenter who makes tables and chairs. He can make up to 10 tables or 20 chairs per day, or any combination of them that does not exceed his capacity. He sells a table for $100 and a chair for $40. On Monday, he made 6 tables and 8 chairs. On Tuesday, he made as many chairs as possible without exceedi...
def solve() -> int: table_capacity = 10 chair_capacity = 20 table_price = 100 chair_price = 40 monday_tables = 6 monday_chairs = 8 tuesday_chairs = chair_capacity - table_capacity wednesday_tables = monday_tables wednesday_chairs = monday_chairs monday_earnings = monday_tables * ...
Student: An ice cream shopkeeper has 80 vanilla ice cream cones which he sells at 2.50 dollars each and 60 chocolate ice cream cones which he sells at 3 dollars each. If all the cones are sold, what is the total amount of money earned by the shopkeeper?
def solve() -> int: vanilla_cones = 80 vanilla_price = 2.50 chocolate_cones = 60 chocolate_price = 3 total_vanilla_price = vanilla_cones * vanilla_price total_chocolate_price = chocolate_cones * chocolate_price result = total_vanilla_price + total_chocolate_price return result
Student: A supermarket buys 600 packs of flour for $1000. If each pack weighs 5 kg, and the supermarket sells each kg of flour for $2. How much profit does the supermarket make if they sell all the flour?
def solve() -> int: packs_of_flour = 600 cost_of_flour = 1000 weight_of_pack = 5 price_per_kg = 2 total_weight = packs_of_flour * weight_of_pack total_revenue = total_weight * price_per_kg total_cost = cost_of_flour profit = total_revenue - total_cost result = profit return res...
A box has a length of 50 cm, a width of 30 cm, and a height of 20 cm. What is the volume of the box?
def solve() -> int: length = 50 width = 30 height = 20 volume = length*width*height result = volume return result
Max wants to change up his room and decides to replace all of his plain curtains with ones that have patterns. He buys 14 polka dot curtains, 4 times as many floral curtains, and 10 striped curtains. If he still needs to buy 6 more patterned curtains, how many plain curtains did Max have initially?
def solve() -> int: polka_dot_curtains = 14 floral_curtains = 4 * polka_dot_curtains striped_curtains = 10 total_patterned_curtains = polka_dot_curtains + floral_curtains + striped_curtains remaining_patterned_curtains = 6 initial_plain_curtains = total_patterned_curtains - remaining_patterned_c...
John is planning his next hiking trip. The trail guide suggests that hikers should bring 1 liter of water for every 2 hours of hiking. John plans to hike for 8 hours. How many liters of water should he bring?
def solve() -> int: hours = 8 water_per_hour = 1 / 2 total_water_needed = hours * water_per_hour result = total_water_needed return result
Student: Kendra got a bill for $250, and her parents said they would take care of 40% of it. How much does Kendra need to pay?
def solve() -> int: bill = 250 percentage = 0.4 amount_taken_care_of = bill * percentage amount_to_pay = bill - amount_taken_care_of result = amount_to_pay return result
am wants to make a fruit smoothie. He needs 1/2 cup of strawberries, 1/4 cup of blueberries, and 1/4 cup of blackberries. What is the total amount of fruit needed in cups?
def solve() -> int: strawberries = 1/2 blueberries = 1/4 blackberries = 1/4 total_fruit = strawberries + blueberries + blackberries result = total_fruit return result
7. Haley went to a store and spent $20. She got $10 change back. How much money did she pay at the store?
def solve() -> int: change_back = 10 money_paid = 20 + change_back result = money_paid return result
A group of friends went out to eat and the bill was $75. They want to split the bill evenly, but one person had to leave early so they only paid for 2/3 of their meal. If there were 5 people, how much does each person owe?
def solve() -> int: bill = 75 people = 5 one_person_paid = bill * (2/3) total_paid = bill - one_person_paid price_per_person = total_paid / (people - 1) result = price_per_person return result
If Laura takes 8 flights of stairs with each flight having 13 steps, and each step is 0.75ft, how many feet does Laura climb up in total?
def solve() -> int: num_flights = 8 steps_per_flight = 13 step_length = 0.75 total_steps = num_flights * steps_per_flight total_distance = total_steps * step_length result = total_distance return result
Lily and Mia are making cupcakes. Lily can make 12 cupcakes in an hour. Mia can make 9 cupcakes in an hour. They start making cupcakes at the same time and stop after 3 hours. They share 6 cupcakes with their friends. How many cupcakes do they have left?
def solve() -> int: lily = 12 * 3 mia = 9 * 3 total = lily + mia shared = 6 left = total - shared result = left return result
A rectangle has an area of 24 square meters. Its length is twice its width. What are the dimensions of the rectangle?
def solve() -> int: area = 24 length_width_ratio = 2 width = (area/length_width_ratio)**0.5 length = width * length_width_ratio result = (length, width) return result