question stringlengths 11 2.89k | code stringlengths 20 7.24k |
|---|---|
Possible questions and programs: Mira collected 180 seashells from the beach. She gave 1/3 of them to her friend, and kept 1/4 of the remaining seashells for herself. She then sold 2/3 of the rest for $0.5 each. How much money did she earn from selling the seashells? | def solve() -> int:
seashells = 180
seashells = seashells - (seashells / 3)
seashells = seashells - (seashells / 4)
money = (seashells / 3) * 2 * 0.5
result = money
return result
|
The perimeter of a rectangle is 34, and its length is 10. What is the width of the rectangle? | def solve() -> int:
perimeter = 34
length = 10
width = (perimeter - (2 * length)) / 2
result = width
return result
|
Jack invested $5000 and earned 5.8% interest rate with compounding over a period of 2 years. He then added twice as much to his invetment and the next year he earned a 15% return on his investments. How much money does he have now? | def solve() -> int:
principal = 5000
interest_rate = 5.8/100
num_yrs = 2
final_bal = principal * (1 + (interest_rate * num_yrs))
multiplier = 2
addition = multiplier * principal
interest_rate_2 = 15/100
final_bal_2 = (final_bal + addition) * (1 + (interest_rate_2))
result ... |
A farmer's field is rectangular with an area of 600 sq ft. If the width of the field is 20 feet and he wants to increase it by 2 feet on each side, what is the new area of the field? | def solve() -> int:
length = 600 / 20
new_width = 20 + 2 + 2
new_area = length * new_width
result = new_area
return result
|
Student: A water tank can hold 200 gallons of water. If a swimming pool can hold ten times as much water as the tank, how many gallons can the swimming pool hold? | def solve() -> int:
tank_capacity = 200
pool_capacity = tank_capacity * 10
result = pool_capacity
return result
|
In the pizza parlor, Ethan orders a pepperoni pizza, his girlfriend orders a mushroom pizza, his brother orders a sausage pizza, and his father orders a supreme pizza. The sausage pizza has 6 slices, the supreme pizza has 3 more slices than the mushroom pizza, and the pepperoni pizza has half as many slices as the saus... | def solve() -> int:
sausage_slices = 6
mushroom_slices = sausage_slices + 3
pepperoni_slices = sausage_slices / 2
total_slices = sausage_slices + mushroom_slices + pepperoni_slices
result = total_slices
return result
|
Student: Kayla had $32 in her account. She spent $6 on stationery and $12 on eraser. How much is left in her account? | def solve() -> int:
account_balance = 32
stationery_cost = 6
eraser_cost = 12
account_balance -= stationery_cost
account_balance -= eraser_cost
result = account_balance
return result
|
A store offers discount in the sales. Sharon brought a TV for $560 with a 15% discount. How much did she pay after the discount? | def solve() -> int:
price = 560
discount_percent = 0.15
discount = price * discount_percent
final_price = price - discount
result = final_price
return result
|
-You may use the following helper function to round the result to two decimal places if needed (Do not change this function): def round2(num): return round(num*100)/100 Here are 10 possible questions and programs: Ken had 120 stickers. He gave 15 stickers to his friend Tom. He then bought 6 more packs of stickers, each... | def solve() -> int:
stickers_left = 120 - 15
stickers_bought = 6 * 8
stickers_total = stickers_left + stickers_bought
result = stickers_total
return result
|
Marcy bought three times as many apples as oranges. If she has a total of 28 fruits, how many oranges did she buy? | def solve() -> int:
total_fruits = 28
num_oranges = 0
num_apples = 0
num_apples = total_fruits * 3 // 4
num_oranges = total_fruits - num_apples
result = num_oranges
return result
|
A phone costs $600. If Nina pays $150 as down payment and $35 every week for 20 weeks, how much interest will Nina pay if she takes up a loan with a 10% rate? | def solve() -> int:
down_payment = 150
weekly_payment = 35
weeks = 20
interest_rate = 0.10
total_price = 600
total_paid = down_payment + (weekly_payment * weeks)
interest_charge = (total_price - down_payment) * interest_rate
result = interest_charge
return result
|
Tina and her two cousins agree to share the cost of a hotel room. The hotel room is 35% more expensive than Tina's usual hotel booking which is $200 per night. How much does Tina save per night by sharing the hotel room with her cousins? | def solve() -> int:
tinas_booking = 200
hotel_room = tinas_booking * 1.35
total_cost = hotel_room / 3
tinas_share = total_cost - tinas_booking
result = tinas_share
return result
|
Student: A recipe needs 3 eggs to make a cake. How many eggs are needed to make 5 cakes? | def solve() -> int:
eggs_per_cake = 3
cakes = 5
eggs = eggs_per_cake * cakes
result = eggs
return result
|
Student: Jane bought a shirt that cost her $45. She got a 15% discount. How much did she pay? | def solve() -> int:
shirt_cost = 45
discount = 0.15 * shirt_cost
final_cost = shirt_cost - discount
result = final_cost
return result
|
Student: David’s uncle gave him a rectangular piece of paper. The paper has a length of 12 inches and a width of 8 inches. How many square inches of paper did David’s uncle give him? | def solve() -> int:
length = 12
width = 8
area = length * width
result = area
return result
|
A man started with 800 dollars. He lost 250 dollars on Monday and 330 dollars on Tuesday. Then he won 410 dollars on Wednesday and won another 80 dollars on Thursday. How much money does he have now? | def solve() -> int:
money = 800
money -= 250
money -= 330
money += 410
money += 80
result = money
return result
|
A pizza place charges $12 per pizza and $1 for each topping. If Devon ordered 3 pizzas each with 2 toppings, how much was his total bill? | def solve() -> int:
total_price = 3 * 12 + 3 * 2
result = total_price
return result
|
Student: Ms. Jones wants to set up 10 tables at her event. If she has purchased 50 chairs, how many chairs will be left over? | def solve() -> int:
tables = 10
chairs = 50
chairs_needed = tables * 5
left_over = chairs - chairs_needed
result = left_over
return result
|
A store is having a sale with 20% off all items. If Sarah buys a shirt for $15, how much will she pay after the discount? | def solve() -> int:
original_price = 15
discount = 0.20
discount_amount = original_price*discount
final_price = original_price - discount_amount
result = final_price
return result
|
In seven years, Mark will be ten times as old as his pet dog Max. If Max is currently 3 years old, how old was Mark three years ago? | def solve() -> int:
max_age = 3
mark_age_in_seven_years = 10 * (max_age + 7)
mark_age_three_years_ago = mark_age_in_seven_years - 3
result = mark_age_three_years_ago
return result
|
Student: Three times Jason's age minus 24 is equal to four times the difference of Mia's age and 9. If Mia is currently 21 years old, how old will Jason be 15 years from now? | def solve() -> int:
jason_age = 0
mia_age = 21
jason_age = (3 * mia_age - 24) / 4 + 9
jason_age_15_years_from_now = jason_age + 15
result = jason_age_15_years_from_now
return result
|
Melissa has 5 more balloons than Sam. If Sam has 10 balloons, how many balloons do they have in total? | def solve() -> int:
sam_balloons = 10
melissa_balloons = sam_balloons + 5
total_balloons = sam_balloons + melissa_balloons
result = total_balloons
return result
|
A factory produces 500 widgets. If 15 percent of them are defective, and 80 percent of the defective widgets are repaired, how many widgets are repaired? | def solve() -> int:
total_widgets = 500
defective_percent = 15
repaired_percent = 80
defective_widgets = (defective_percent / 100) * total_widgets
repaired_widgets = (repaired_percent / 100) * defective_widgets
result = repaired_widgets
return result
|
If 3x - 2y = 12 and x + y = 7, what is the value of x? | def solve() -> int:
from sympy.solvers import solve
from sympy import Symbol
x = Symbol('x')
y = Symbol('y')
eq1 = 3*x - 2*y - 12
eq2 = x + y - 7
soln = solve((eq1, eq2), (x, y))
result = soln[x]
return result
|
Mike drove for 3 hours at a speed of 50 mph and covered a total distance of 150 miles. What was his average speed? | def solve() -> int:
time = 3
distance = 150
speed = distance/time
result = speed
return result
|
A train travels 16 kilometers in twelve minutes. What is the train's average speed in km/h? | def solve() -> int:
distance = 16
time = 12
speed_in_km_per_min = distance / time
speed_in_km_per_h = speed_in_km_per_min * 60
result = speed_in_km_per_h
return result
|
Charlotte has 55 brown pencils and 50 gray pencils. She gives her friend Ethan 3/4 of her brown pencils and 2/5 of her gray pencils. If Ethan has 41 brown pencils and 12 gray pencils, how many total pencils does he have? | def solve() -> int:
brown_pencils_charlotte = 55
gray_pencils_charlotte = 50
brown_pencils_ethan = 41
gray_pencils_ethan = 12
brown_pencils_given = (3/4) * brown_pencils_charlotte
gray_pencils_given = (2/5) * gray_pencils_charlotte
total_pencils_ethan = brown_pencils_ethan + g... |
Student: A grocery store sold 15 cartons of eggs for $2.00 each, 20 gallons of milk for $4.00 each, and 35 pounds of oranges for $1.50 each. How much money did the grocery store make? | def solve() -> int:
cartons_of_eggs = 15
gallons_of_milk = 20
pounds_of_oranges = 35
cost_of_eggs = cartons_of_eggs * 2.00
cost_of_milk = gallons_of_milk * 4.00
cost_of_oranges = pounds_of_oranges * 1.50
total_cost = cost_of_eggs + cost_of_milk + cost_of_oranges
result = total_cost
... |
Chloe walks 13,500 steps on a 7-kilometer route. If she walks around the route 4 and 1/2 times, how many steps will she have walked? Lena, Marco, and Alex buy $270 worth of candy at a store. Lena spends three times more than Marco and Marco spends twice as much as Alex. How much did Alex spend? | def solve() -> int:
route_distance = 7
total_steps = 13500
steps_per_kilometer = total_steps / route_distance
steps_walked = steps_per_kilometer * (4.5 * route_distance)
result = steps_walked
candy_cost = 270
alex_spent = candy_cost / (1 + 2 + 3)
result = a... |
A farm has 60 animals. Two animals die due to a disease, then half of the remaining animals get bitten by snakes. If only 1/10 of the bitten animals recover, how many animals are left on the farm? | def solve() -> int:
animals = 60
animals -= 2
animals /= 2
bitten = animals
bitten *= 0.5
recovered = bitten
recovered *= 0.1
animals -= recovered
result = animals
return result
|
There are two boxes of apples. The first box has 8 apples and the second has 30 apples. How many more apples are in the second box than the first? | def solve() -> int:
box_1 = 8
box_2 = 30
difference = box_2 - box_1
result = difference
return result
|
Michael borrowed $300 from his friend. He returned $150 and then spent 3/4 of the remaining money on groceries. How much money did Michael spend on groceries? | def solve() -> int:
borrowed_money = 300
returned_money = 150
remaining_money = borrowed_money - returned_money
spent_on_groceries = (3/4) * remaining_money
result = spent_on_groceries
return result
|
A toy factory produces 60 toys every hour. How many toys can they produce in a day? | def solve() -> int:
toys_per_hour = 60
hours_per_day = 24
toys_per_day = toys_per_hour * hours_per_day
result = toys_per_day
return result
|
A swimming pool is 25 meters long, 10 meters wide, and 3 meters deep. How much water is needed to fill the pool? | def solve() -> int:
length = 25
width = 10
depth = 3
volume = length * width * depth
result = volume
return result
|
A rectangular garden measures 9ft by 13ft. If a brick path 2ft wide is added around the garden, what is the area of the brick path? | def solve() -> int:
length = 13
width = 9
path_width = 2
path_length = length + 2*path_width
path_width = width + 2*path_width
total_area = path_length * path_width - length * width
result = total_area
return result
|
Lily wants to buy a new camera. She plans to sell 6 handmade cards for $8 each, work at the pet store for 7 hours at $7 per hour, and complete 2 dog-walking jobs for $20 each. If her earnings just cover the cost of the camera, how much does it cost? | def solve() -> int:
cards_sold = 6
card_price = 8
pet_store_hours = 7
hourly_rate = 7
dog_walking_jobs = 2
dog_walking_price = 20
total_earnings = (cards_sold * card_price) + (pet_store_hours * hourly_rate) + (dog_walking_jobs * dog_walking_price)
camera_cost = total_earnings
... |
9. Clare has 120 cookies. She wants to divide them evenly among 5 people. How many cookies will each person get? | def solve() -> int:
num_cookies = 120
num_people = 5
cookies_per_person = num_cookies / num_people
result = cookies_per_person
return result
|
Ethan had $900. He spent $400 on a new laptop, and then spent three-quarters of what's left on a guitar. Ethan then lost a third of what he has left. How much money does he have left? | def solve() -> int:
money_start = 900
laptop_cost = 400
money_left = money_start - laptop_cost
guitar_cost = money_left * 0.75
money_left = money_left - guitar_cost
money_left = money_left * (2/3)
result = money_left
return result
|
Kevin is making lemonade. He needs 6 lemons, 1/2 cup of sugar, and 8 cups of water. The lemons cost 20 cents each, the sugar costs 5 cents per teaspoon, and the water is free. How much does it cost to make the lemonade? | def solve() -> int:
lemons_cost = 6 * 0.20
sugar_cost = 1/2 * 48 * 0.05
water_cost = 0
lemonade_cost = lemons_cost + sugar_cost + water_cost
result = lemonade_cost
return result
|
Kevin has 180 coins in his piggy bank. Half of the coins are pennies, and a fifth of the pennies are shiny. How many shiny pennies are there? | def solve() -> int:
pennies = 180 / 2
shiny_pennies = pennies / 5
result = shiny_pennies
return result
|
Student: Mary has 100 apples. She divides them into 4 equal baskets. How many apples are in each basket? | def solve() -> int:
apples = 100
baskets = 4
apples_in_each_basket = apples // baskets
result = apples_in_each_basket
return result
|
A box contains 15 white balls and 10 red balls. If two balls are selected randomly, what is the probability that both of them are white? | def solve() -> int:
white_balls = 15
total_balls = 25
probability = (white_balls/total_balls)*((white_balls-1)/(total_balls-1))
result = probability
return result
|
Student: Sarah is a gardener. She sells flowers and plants at a local market. She buys flowers for $0.5 each and sells them for $1 each. She buys plants for $2 each and sells them for $3 each. She also pays a $10 fee for renting a stall at the market. One day, she sold 40 flowers and 15 plants. How much profit did she ... | def solve() -> int:
cost_flower = 0.5
cost_plant = 2
revenue_flower = 1
revenue_plant = 3
fee = 10
sold_flower = 40
sold_plant = 15
total_cost = cost_flower * sold_flower + cost_plant * sold_plant
total_revenue = revenue_flower * sold_flower + revenue_plant * sold_plant
... |
A school has a total of 500 students. If 60% of the students are girls, how many boys are there in the school? | def solve() -> int:
total_students = 500
girls_percent = 0.6
boys_percent = 1 - girls_percent
boys_count = total_students * boys_percent
result = boys_count
return result
|
A pool has a volume of 50,000 liters. The pool is being drained at a rate of 100 liters per minute. How long will it take to drain the pool completely? | def solve() -> int:
volume = 50000
rate = 100
time = volume / rate
result = time
return result
|
Result: 2 A football stadium has a seating capacity of 80,000 people. If the stadium is 70% full, how many people are currently watching the game? | def solve() -> int:
seating_capacity = 80000
percent_full = 70
people_currently_watching = seating_capacity * (percent_full / 100)
result = people_currently_watching
return result
|
A store has a total of 400 items. If they sell 75 each day, how many days will it take to sell all items? | def solve() -> int:
total_items = 400
items_sold_per_day = 75
days_to_sell_all_items = total_items / items_sold_per_day
result = days_to_sell_all_items
return result
|
Possible math questions and python programs: Bob has 5 baskets of apples, 7 baskets of oranges, and 4 baskets of bananas. Each basket of apples has 12 apples, each basket of oranges has 15 oranges, and each basket of bananas has 10 bananas. How many fruits are there total? | def solve() -> int:
apples = 5 * 12
oranges = 7 * 15
bananas = 4 * 10
total = apples + oranges + bananas
result = total
return result
|
Student: Joanna got paid $900 for her part-time job at the bookstore and she spent $150 for a magazine subscription, $50 for new shoes, and $550 for rent. How much does she have left? | def solve() -> int:
pay = 900
magazine_subscription = 150
shoes = 50
rent = 550
left = pay - magazine_subscription - shoes - rent
result = left
return result
|
A swimming pond in a natural reserve has a leak. It starts with 5000 liters of water. It loses 20 liters of water per hour. Robert doesn't add any water for the first two hours. He adds 5 liters of water to the pond in hour three. He adds 3 liters of water in hour four. How much water is left in the pond at the end of ... | def solve() -> int:
initial_water = 5000
water_loss = 20
water_left = initial_water - (water_loss * 2)
water_left += 5
water_left += 3
result = water_left
return result
|
A swimming pool has a capacity of 8000 gallons of water. How many gallons of water will be in the pool if it's filled for 2 weeks? | def solve() -> int:
capacity = 8000
water_per_day = capacity / 7
water_for_two_weeks = water_per_day * 14
result = water_for_two_weeks
return result
|
A 10% discount is applied to a shirt that normally costs $25. What is the new cost of the shirt? | def solve() -> int:
original_cost = 25
discount_percent = 10
discounted_amount = original_cost * (discount_percent/100)
new_cost = original_cost - discounted_amount
result = new_cost
return result
|
If a piece of string measures 8 inches when folded in half, what is the length of the string? | def solve() -> int:
string_length = 8*2
result = string_length
return result
|
Nancy is organizing a party with 5 people and wants to prepare enough cake for everyone. If the cake has 8 slices and there are 4 extra slices, how many total slices of cake will Nancy have to prepare? | def solve() -> int:
num_guests = 0
num_extra_slices = 0
total_slices = 0
num_guests = 5
num_extra_slices = 4
total_slices = (num_guests * 8) + num_extra_slices
result = total_slices
return result
|
A farmer has 100 cows. If each cow produces an average of 5.5 gallons of milk per day, how many gallons of milk are produced in one week? | def solve() -> int:
num_cows = 100
gallons_per_cow_per_day = 5.5
days_in_week = 7
total_gallons = num_cows * gallons_per_cow_per_day * days_in_week
result = total_gallons
return result
|
am has 50 books in his shelf. Alex has twice as many books as Sam while Jason has half the amount of books Sam and Alex have combined. How many books do the three have total? | def solve() -> int:
samsBooks = 50
alexBooks = samsBooks*2
jasonBooks = (samsBooks + alexBooks)*0.5
total = samsBooks + alexBooks + jasonBooks
result = total
return result
|
Student: Jason earns $10 an hour and works 20 hours each week. He saves 20% of his earnings and puts the rest towards his $100 monthly phone bill. How much money does he have left after paying the phone bill each month? | def solve() -> int:
hourly_wage = 10
weekly_hours = 20
savings_percentage = 0.2
monthly_phone_bill = 100
monthly_earnings = hourly_wage * weekly_hours * 4
monthly_savings = monthly_earnings * savings_percentage
result = monthly_earnings - monthly_phone_bill - monthly_savings
return resu... |
Alice is a gymnast. She practices three times as many hours on the third day as on the second day. On the sixth day, she practices for 54 hours. How many hours did Alice practice on the second day? | def solve() -> int:
second_day_hours = 4.5
result = second_day_hours
return result
|
Mia has four more than twice as many bracelets as her friend Ava has. If Ava has 5 bracelets, how many bracelets does Mia have? On the final day of a bike convention, 60 bicyclists gathered to ride together. If each bike had two wheels, how many wheels were on the road? | def solve() -> int:
ava_bracelets = 5
mia_bracelets = 2 * ava_bracelets + 4
total_bicyclists = 60
total_wheels = total_bicyclists * 2
result = mia_bracelets
result = total_wheels
return result
|
Student: Jeff invested $500 in Bitcoin. In the first week, it lost 10% in value. In the second week, it gained 15% on top of the previous loss. How much is his investment worth now? | def solve() -> int:
investment = 500
first_week_loss = investment * 0.1
second_week_gain = (investment - first_week_loss) * 0.15
result = investment - first_week_loss + second_week_gain
return result
|
Ryan bought 5 packs of postcards; if he gave two to his mother and distributed the remaining packs equally among his three siblings, how many packs did each sibling receive? | def solve() -> int:
sum = 5
x = 2
dist = sum-x
per_person = dist/3
result = per_person
return result
|
Student: A 3-drawer dresser has a width of 36 inches. If each drawer has a width of 10 inches, how much space is left over on the dresser? | def solve() -> int:
drawer_width = 10
num_drawers = 3
total_drawer_width = drawer_width * num_drawers
dresser_width = 36
space_left_over = dresser_width - total_drawer_width
result = space_left_over
return result
|
Logan needs to run 2 miles a day in order to prepare for a marathon. However, because of an injury, he misses 8 days of running. How many more miles does he need to run in the remaining days to reach his goal of running a full marathon which is 26.2 miles long? | def solve() -> int:
goal_distance = 26.2
daily_distance = 2
missed_days = 8
total_distance = goal_distance - (daily_distance * missed_days)
remaining_days = 365 - missed_days
distance_per_day = total_distance / remaining_days
result = distance_per_day
return resu... |
If a car consumes 10 liters of fuel every 100 km, how many liters of fuel will it need to travel a distance of 420 km? | def solve() -> int:
fuel_consumption = 10
distance = 420
fuel_required = (fuel_consumption/100) * distance
result = fuel_required
return result
|
Grace has a bag of 20 marbles. The bag contains 5 red marbles, 8 blue marbles, and 7 green marbles. She draws 3 marbles without replacement. What is the probability that she draws exactly 2 red marbles and 1 blue marble? | def solve() -> int:
probability = (5/20) * (4/19) * (8/18)
result = probability
return result
|
Claire has 8 boxes of books. In each box, there are 45 books, 1/3 of them are hardcover and 2/5 are paperback. How many hardcover books does Claire have? | def solve() -> int:
boxes = 8
books_per_box = 45
pct_hardcover = 1/3
pct_paperback = 2/5
num_hardcover = boxes * books_per_box * pct_hardcover
result = num_hardcover
return result
|
ome possible new questions and programs are: Jenna earns $12 for every shirt she sews and $4 for every button she attaches. If she sews 10 shirts and attaches 36 buttons, how much does she earn in total? | def solve() -> int:
sew_earn = 12
button_earn = 4
sew_shirts = 10
attach_buttons = 36
total_earn = sew_earn * sew_shirts + button_earn * attach_buttons
result = total_earn
return result
|
Student: A farmer planted a field of corn. After harvesting, the farmer got 2890 ears of corn. Each ear had an average of 550 kernels. How many kernels of corn did the farmer harvest? | def solve() -> int:
ears = 2890
kernels_per_ear = 550
total_kernels = ears * kernels_per_ear
result = total_kernels
return result
|
Deena spent 5/6 of her gardening time weeding and the other 1/4 of her time planting. How many hours did Deena spend gardening in total? | def solve() -> int:
time_weeding = 5/6
time_planting = 1/4
total_time = time_weeding + time_planting
result = total_time
return result
|
If James can complete a puzzle in 30 minutes and it takes his sister Annabelle twice as long to complete the same puzzle, how long will it take them to complete it if they work on it together? | def solve() -> int:
james_time = 30
annabelle_time = 2 * james_time
total_time = (james_time * annabelle_time) / (james_time + annabelle_time)
result = total_time
return result
|
Student: Jeremy has $345 in his bank account. He spends $98 on groceries and $76 on clothes. How much money does he have left? | def solve() -> int:
bank_account = 345
groceries = 98
clothes = 76
money_left = bank_account - groceries - clothes
result = money_left
return result
|
Student: In one year, Tom bought 10 movie tickets and 3 popcorn each ticket costs $15 and the popcorn costs $5 each How much did Tom spend in total? | def solve() -> int:
ticket_num = 10
popcorn_num = 3
ticket_price = 15
popcorn_price = 5
total_cost = ticket_num * ticket_price + popcorn_num * popcorn_price
result = total_cost
return result
|
A company ordered 200 markers for their employees. Each box contains 24 markers and costs $4 per box. If they want to distribute equally to each employee and still have 8 markers left over, how many employees does the company have and how much will each employee get? | def solve() -> int:
markers_per_box = 24
cost_per_box = 4
total_markers_ordered = 200
boxes_ordered = total_markers_ordered / markers_per_box
total_cost = boxes_ordered * cost_per_box
employees = total_markers_ordered // markers_per_box
markers_left_over = total_markers_o... |
Mr. Johnson bought a laptop that costs $1,200 and a printer that costs $300. If he had a coupon that gave him a 15% discount on the printer, what is the total amount he paid? | def solve() -> int:
cost_laptop = 1200
cost_printer = 300
discount = 15 / 100
new_cost_printer = cost_printer - (cost_printer * discount)
total_cost = cost_laptop + new_cost_printer
result = total_cost
return result
|
Sarah wants to organize a book club meeting for 30 members. If each person needs a copy of the book, and the bookstore has 40 copies in stock, how many more copies does the bookstore need to order to fulfill the book club's needs? A sporting goods store sells footballs for $20, basketballs for $15, and soccer balls for... | def solve() -> int:
members = 30
copies_needed = members
copies_in_stock = 40
copies_to_order = copies_needed - copies_in_stock
result = copies_to_order
footballs_sold = 40
basketballs_sold = 25
soccer_balls_sold = 30
football_price = 20
... |
During a company event, Carla wants to have 4 bottles of wine per table. Each bottle holds 1.5 liters. If there are 5 tables in the event, and one bottle of wine costs $16, what will be the total cost of the wine? | def solve() -> int:
bottles_per_table = 4
liters_per_bottle = 1.5
num_tables = 5
price_per_bottle = 16
total_bottles = bottles_per_table * num_tables
total_liters = total_bottles * liters_per_bottle
total_cost = total_bottles * price_per_bottle
result = total_cost
return result
|
David wants to create a pattern with blue and black squares in the shape of a diamond. He needs 11 blue squares for each point of the diamond and 22 black squares for the background. If he needs 2 times the number of squares in the background to make the grey squares, how many squares does he need in total? | def solve() -> int:
blue_squares_per_point = 11
black_squares_background = 22
total_points = 4
total_blue_squares = blue_squares_per_point * total_points
total_black_squares = black_squares_background * total_points
grey_squares = 2 * total_black_squares
total_s... |
Student: There are 39 tulips, 46 zinnias, and 35 roses in a flower garden. If one third of the tulips, two fifths of the zinnias, and one quarter of the roses are picked, how many flowers remain? | def solve() -> int:
tulips = 39
zinnias = 46
roses = 35
picked_tulips = tulips / 3
picked_zinnias = zinnias * 2 / 5
picked_roses = roses / 4
total_picked = picked_tulips + picked_zinnias + picked_roses
remaining = tulips + zinnias + roses - total_picked
result = remaining
return... |
Jack has 5 bags of apples, each with 10 apples each. He also has 3 baskets that each can hold 12 apples. How many apples will Jack have left over if he divided them evenly among the baskets? | def solve() -> int:
number_of_bags = 5
num_apples_in_bag = 10
num_baskets = 3
num_apples_in_basket = 12
total_num_apples = number_of_bags * num_apples_in_bag
num_apples_divided = num_baskets * num_apples_in_basket
result = total_num_apples - num_apples_divided
... |
A company produces 120 units per hour. If they work for 8 hours a day, how many units do they produce per week? | def solve() -> int:
units_per_hour = 120
hours_per_day = 8
units_per_day = units_per_hour * hours_per_day
units_per_week = units_per_day * 7
result = units_per_week
return result
|
John is building an outdoor shed. The shed has four walls, each 8 feet high and 10 feet long. How much siding does John need to cover the entire shed? | def solve() -> int:
height = 8
length = 10
num_walls = 4
area_wall = height * length
area_shed = area_wall * num_walls
siding_needed = area_shed
result = siding_needed
return result
|
Student: Josephine wants to paint a mural on a wall that is 20 feet wide and 15 feet tall. How many square feet will Josephine need to paint on? | def solve() -> int:
width = 20
height = 15
area = width * height
result = area
return result
|
Michael and his friends played two games of chess. The first game lasted 25 minutes and the second game lasted 15 minutes longer than the first. Before the games, they spent 5 minutes setting up the board and pieces and after the games, they spent 10 minutes discussing their moves. How long, in minutes, did it take Mic... | def solve() -> int:
game_1 = 25
game_2 = game_1 + 15
setup = 5
discussion = 10
total_time = game_1 + game_2 + setup + discussion
result = total_time
return result
|
Zoe bakes 3 dozen muffins. She sells 8 of them at a bake sale. She shares 12 of them with her family. How many muffins does she have left? | def solve() -> int:
baked = 3 * 12
sold = 8
shared = 12
left = baked - sold - shared
result = left
return result
|
Student: A recipe calls for 3 cups of flour to make 30 cookies. How many cups of flour are needed to make 60 cookies? | def solve() -> int:
cookies = 60
cookies_per_cup = 30
cups_of_flour = cookies / cookies_per_cup * 3
result = cups_of_flour
return result
|
Grace received $1000 from selling her old furniture. She used $300 of that money to buy new furniture and gave 3/8 of the remaining to her sister. How much money does she have left? Samantha gets a food assistance because she's low-income. If she gets a raise of $1.25/hour and works 30 hours a week, how much more will ... | def solve() -> int:
total_money = 1000
new_furniture_cost = 300
remaining_money = total_money - new_furniture_cost
sister_money = remaining_money * 3/8
grace_money_left = remaining_money - sister_money
raise_per_hour = 1.25
hours_per_week = 30
reduced_food_benefits = 40
extra_ea... |
Juan has 3 red and 5 blue Lego bricks, while his brother has 2 red and 4 blue Lego bricks. How many more blue bricks do they need to make a tower of 12 blue bricks? | def solve() -> int:
juan_red_bricks = 3
juan_blue_bricks = 5
brother_red_bricks = 2
brother_blue_bricks = 4
total_blue_bricks = juan_blue_bricks + brother_blue_bricks
bricks_needed = 12
more_bricks_needed = bricks_needed - total_blue_bricks
result = more_bricks_needed
return result
|
A recipe calls for 2 cups of flour and 1 cup of sugar. How many cups of flour are needed if there are 3 cups of sugar? | def solve() -> int:
flour_to_sugar_ratio = 2/1
sugar_cups = 3
flour_cups = int((sugar_cups/flour_to_sugar_ratio) * 2)
result = flour_cups
return result
|
A recipe calls for 3/4 cup of milk and 1/3 cup of flour. If you want to double the recipe, how much of each ingredient do you need? | def solve() -> int:
milk = 3/4
flour = 1/3
doubled_milk = milk * 2
doubled_flour = flour * 2
result = doubled_milk, doubled_flour
return result
|
The sum of three consecutive even numbers is 66. What is the smallest of those numbers? | def solve() -> int:
sum = 66
second_num = sum / 3
first_num = second_num - 2
third_num = second_num + 2
result = first_num
return result
|
Student: If Lily spends 2 hours per day on her commute and sleeps 8 hours per day, how many hours per week does she have left for leisure if she works 50 hours per week? | def solve() -> int:
commute_time = 2
sleep_time = 8
work_time = 50
total_time = commute_time + sleep_time
leisure_time = work_time - total_time
leisure_time_per_week = leisure_time * 7
result = leisure_time_per_week
return result
|
Aliya and Rohan are playing a game with colored beads. Aliya gets 3 red beads, 5 green beads, and 10 blue beads for each round. Rohan gets 6 red beads, 4 green beads, and 8 blue beads for each round. If they each get 2 rounds, how many beads do they have in total? | def solve() -> int:
al_red = 3
al_green = 5
al_blue = 10
ro_red = 6
ro_green = 4
ro_blue = 8
al_beads_total = al_red * 2 + al_green * 2 + al_blue * 2
ro_beads_total = ro_red * 2 + ro_green * 2 + ro_blue * 2
total_beads = al_beads_total + ro_beads_total
result = total_beads
... |
A gardener has 120 flowers to plant in a rectangular garden. He decides to plant them in rows of 8. How many rows of flowers will he have? How many flowers will be left over? | def solve() -> int:
rows = 120 // 8
left_over = 120 % 8
result = (rows, left_over)
return result
|
Max charges $7.00 to deliver each pizza. He charges $2.00 for each topping. The customer orders 4 pizzas, and wants 2 of them to have cheese only, and 2 of them to have 3 toppings each. How much will Max charge? | def solve() -> int:
delivery_price = 7
topping_price = 2
total_pizzas = 4
cheese_pizzas = 2
topping_pizzas = 2
toppings_per_pizza = 3
delivery_charge = delivery_price * total_pizzas
topping_charge = topping_price * topping_pizzas * toppings_per_pizza
result = delivery_... |
A company has 500 employees. If 10% of the employees resign, how many employees are left in the company? | def solve() -> int:
initial_employees = 500
resignation_rate = 0.1
employees_left = initial_employees * (1 - resignation_rate)
result = employees_left
return result
|
The base of a trapezoid is 12 cm, its height is 15 cm, and the length of the side parallel to the base is 20 cm. What is the perimeter of the trapezoid? | def solve() -> int:
base = 12
height = 15
side = 20
perimeter = 2 * base + 2 * side
result = perimeter
return result
|
Mary wants to print photos of her recent vacation. Each photo has a size of 8 inches by 10 inches and she only has photo paper that measures 11 inches wide. How many photos can she fit side by side on a single sheet of paper? | def solve() -> int:
width_photo = 8
length_photo = 10
width_paper = 11
number_of_photos = width_paper // width_photo
result = number_of_photos
return result
|
In a library, there are 450 fiction books. There are 90 fewer mystery books than romance books. The rest of the books are either science fiction or historical fiction. If there are 220 science fiction books, how many historical fiction books are in the library? | def solve() -> int:
fiction_books = 450
romance_books = (fiction_books - 220) / 2
mystery_books = romance_books - 90
historical_fiction_books = fiction_books - romance_books - mystery_books - 220
result = historical_fiction_books
return result
|
Possible additional questions: Daniel bought two packs of candles for his birthday cake. Each pack has 12 candles. He used 10 candles for the cake and gave 2 candles to his sister. How many candles does he have left? | def solve() -> int:
packs = 2
candles_per_pack = 12
cake_candles = 10
sister_candles = 2
total_candles = packs * candles_per_pack
candles_left = total_candles - cake_candles - sister_candles
result = candles_left
return result
|
A high-rise apartment building has 20 floors. The distance from the ground floor to the top floor is 70 meters. How many steps would a person need to climb to reach the top floor if each step is 25 cm high? | def solve() -> int:
num_floor = 20
height_per_floor = 70 / num_floor
step_height = 0.25
num_steps = (height_per_floor / step_height) * num_floor
result = num_steps
return result
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.