CSE/ENGR 142 Homework 1

Sample Runs of hw1.exe

User input is shown in red.


How many people are going on the beach trip? 7
Since 5 people can fit in each car, the beach trip requires 2 cars.

How much money does each person have to start with? 15.22
The total amount of money for the beach trip is $106.54

Of the people going on the trip, how many already have sunglasses? 3
Sunglasses cost $6.25 each and 4 people need to buy them.
After sunglasses are bought, the total money left for the trip is $81.54

Volleyballs cost $17.75 each, if groups of 4 people get together to play 
volleyball, you will have to buy 1 volleyballs for $17.75
And while these 4 people play volleyball, the other 3 people can go swimming.

This leaves $63.79 left to spend on music CDs for the trip!


press any key to end


How many people are going on the beach trip? 20
Since 5 people can fit in each car, the beach trip requires 4 cars.

How much money does each person have to start with? 13.45
The total amount of money for the beach trip is $269.00

Of the people going on the trip, how many already have sunglasses? 0
Sunglasses cost $6.25 each and 20 people need to buy them.
After sunglasses are bought, the total money left for the trip is $144.00

Volleyballs cost $17.75 each, if groups of 4 people get together to play 
volleyball, you will have to buy 5 volleyballs for $88.75
And while these 20 people play volleyball, the other 0 people can go swimming.

This leaves $55.25 left to spend on music CDs for the trip!


press any key to end


How many people are going on the beach trip? 14
Since 5 people can fit in each car, the beach trip requires 3 cars.

How much money does each person have to start with? 21.00
The total amount of money for the beach trip is $294.00

Of the people going on the trip, how many already have sunglasses? 6
Sunglasses cost $6.25 each and 8 people need to buy them.
After sunglasses are bought, the total money left for the trip is $244.00

Volleyballs cost $17.75 each, if groups of 4 people get together to play 
volleyball, you will have to buy 3 volleyballs for $53.25
And while these 12 people play volleyball, the other 2 people can go swimming.

This leaves $190.75 left to spend on music CDs for the trip!


press any key to end


Back to main Homework 1 page...