Difficulty: Low
Title: Car Recall (SWITCH Statements)
Description:
NOTE: You have to write the code using a SWITCH statement for this program. No IF statements.
An auto company produced some models of cars that may be difficult to drive because the car wheels are not exactly round. Cars with model numbers 119, 179, 189 through 195, 221, and 780 have been found to have this defect. In addition only the model number of 179 also needs a new bumper.
Output:
Enter the car's model number: 191
Your car is defective. It must be repaired.
Difficulty: Low
Title: Printing
Description:
Printing prices are typically based on the number of copies to be printed.
Output:
Enter the number of copies to be printed: 1001
Price per copy is: $0.25
Total cost is: $250.25
Difficulty: Low
Title: MyPow
Description:
The MyPow application should prompt the user for two numbers and then display the result from the formula and, for comparison, show the same result using the Math pow() method.
Output:
Enter a value for X: 7
Enter a value for Y: 5
The result from using the formula is: 16806.9
The result from using the Math pow() method is: 16807
Difficulty: Medium
Title: Car Payment
Description:
Create a CarPayment application that calculates a monthly car payment after prompting the user for the principal owing (P), the interest rate (r) and the number of monthly payments (m). The monthly car payment is calculated using the formula:
P(r /12) / (1-(1+r/12)-m)
NOTE: In the formula above that is a negative sign in front of the m, which makes it -m.
HINT: To solve don't forget about order of operations and the Math methods that you can use.
NOTE: The output should be formatted using the money / currency format.
Output:
Principal: 20000
Interest Rate: .07
Number of monthly payments: 48
The monthly payment is $470.92
Difficulty: Medium
Title: Package Check
Description:
Your shipping company is going international and you need to rewrite your company's software to use kilograms and cubic meters.
Your international delivery service does not accept packages heavier than 27 kilograms or larger than 0.1 cubic meters (100,000 cubic centimeters). Create a PackageCheck application that prompts the user for the weight of a package and its dimensions in centimeters (length, width, and height), and then displays an appropriate message if the package does not meet the requirements.
length(cm) × width(cm) × height(cm) = cubic centimeters
To calculate the cubic meters:
Output:
Enter package weight in kilograms: 32
Enter package length in centimeters: 10
Enter package width in centimeters: 25
Enter package height in centimeters: 38
Too heavy
Difficulty: Medium
Title: Eggs
Description:
A wholesale egg company bases their prices on the number of individual eggs purchased:
Output:
Enter the number of eggs purchased: 18
The bill is equal to: $0.75
Difficulty: High
Title: Volume
Description:
The volume of objects are calculated differently depending on the shape of the object.
V = lwh
πd3 / 6
V = s3
Output:
1 - Rectangular Prism
2 - Sphere
3 - Cube
Choose from the above choices: 1
Length: 3
Width: 4
Height: 5
The volume is: 60.0
Difficulty: High
Title: Bacteria Growth
Description:
The formula y = nekt can be used for estimating growth where:
Output:
Enter initial bacteria amount: 5
Enter a constant value for k: .8
Enter the growth time period in hours: 8
3009.225189360411 bacteria will be present after 8.0 hours.
Difficulty: High
Title: Decay
Description:
The formula used in the BacteriaGrowth problem can also be used in decay problems. In decay problems, k is negative.
Create an application that allows the user to select from the following options:
Output:
NOTE: I did not enter a negative number for "k", because I hard-coded the value to be negative in my formula.
1. Final Amount
2. Initial Amount
3. Constant (half-life)
Find: 1
Enter initial value (n): 200
Enter the constant (k): .0691
Enter the decay time (t): 10
The final amount answer: 100.00471816729655