Difficulty: Low
Title: Variable Reassignment & Arithmetic (Math)
Description:
Create a Java program to apply variable reassignment and arithmetic operators.
Output:
5
10
6.4567
9.12345
9
17
-10
2
Difficulty: Low
Title: Object Height
Description:
The height of an object at any given time dropped from a starting height of 100 meters is given by the equation:
h = 100 – 4.9 * t * t
NOTE: 't' is the time in seconds
Create an ObjectHeight application that prompts the user for a time less than 4.5 seconds and then displays the height of the object at that time. The application output should look like:
Output:
Enter a time: 2
The height of the object is: 80.4 meters
Difficulty: Low
Title: Height
Description:
Create a Height application that prompts the user for a person's height in inches and coverts the input to feet and inches, for example:
NOTE: Use the Scanner class method of nextInt() to obtain a value from the user. See page 81 in the textbook.
NOTE: There are 12 inches in every foot.
Output:
Enter your height in inches: 68
You are 5 feet and 8 inches tall
Difficulty: Low
Title: Simple Interest
Description:
There are two kinds of interest. Simple and compound. With simple interest, the amount of the deposit remains the same, and the amount of interest is paid at the end of a time interval. For example, if $1,000 is deposited for 7 years at an interest rate of 6% per year, $60 will be deposited at the end of each year.
Amount = Principal * (1 + years * interest rate)
Output:
Enter the principal: 5000
Enter the number of years: 5
Enter the interest rate: .06
The value after the term is: $6,500.00
Difficulty: Low
Title: Pizza Cost
Description:
The cost of making one pizza at a local shop is as follows:
Output:
Enter the diameter of the pizza: 10
The cost of making the pizza is $12.75 before taxes and $13.51 after taxes.
Difficulty: Medium
Title: Project
Description:
Create a Project application to help analyze the time taken for a Java project.
The application should prompt you for the time spent designing, coding, debugging, and testing, and then displays a table showing the percentage of time taken for each part.
NOTE: Use the getPercentInstance() format to format the percentage for each part of the project.
Output:
Enter the number of minutes spent on each of the following project tasks:
Designing: 120
Coding: 240
Debugging: 30
Testing: 30
Task % Time
Designing: 29%
Coding: 57%
Debugging: 7%
Testing: 7%
Difficulty: Medium
Title: Gallon Converter
Description:
Create a GallonConverter application that prompts the user for the number of gallons and then displays the number of quarts, pints, cups, and tablespoons in that number of gallons.
Output:
Enter the number of gallons: 4
In 4.0 gallons there are:
16.0 quarts
32.0 pints
64.0 quarts
1024.0 tablespoons
Difficulty: Medium
Title: Steps Per Day
Description:
Write a program that:
Output:
Enter number of steps for Day 1: 17000
Enter number of steps for Day 2: 12000
Enter number of steps for Day 3: 10000
Enter number of steps for Day 4: 5000
Total number of steps: 44,000
Total number of miles: 22.0
Average steps per day: 11,000
Average miles per day: 5.5
Difficulty: Medium
Title: Days
Description:
Create a Days application that prompts the user for a number of Days. Next have the computer compute and print out the following:
NOTE: Use the Scanner class method of nextInt() to obtain a value from the user.
NOTE: Use NumberFormat.getIntegerInstance to format the output for hours, minutes, and seconds. S
Output:
Enter number of Days: 9
Number of weeks and days: 1 week(s) and 2 day(s)
Number of hours: 216
Number of minutes: 12,960
Number of Seconds: 777,600
Difficulty: Medium
Title: Change
Description:
Create a Change application that prompts the user for an amount of change in cents and then displays the minimum number of coins necessary to make the change (i.e. start with determining how many quarters, then dimes, etc.). The change can be made of quarters, dimes, nickels, and pennies.
NOTE: The amount of change is reduced each time you determine the number of quarters, then dimes, and then nickels.
Output:
Enter the change in cents: 212
The minimum number of coins is:
Quarters: 8
Dimes: 1
Nickels: 0
Pennies: 2
Difficulty: Medium
Title: Digits
Description:
Create a Digits application that will show the hundreds-place, tens-place, and ones-place.
HINT: The way I solved this problem was using a mixture of integer division, subtraction at times, and mod division. I started first with the hundreds spot and division, then ten's spot with some subtraction and division, and then one's spot using modulus.
Output:
Enter a three-digit number: 258
The hundreds place is: 2
The tens place is: 5
The ones place is: 8
Difficulty: High
Title: Election
Description:
Create an Election application that will prompt the user for the number of Votes for two candidates - Awbrey and Martinez. After prompting for the number of votes from each state, calculate the percentage of votes for both candidates and display the results.
Output:
Please enter the results for Awbrey:
Maryland: 645612
Delaware: 304134
Virginia: 734564
Please enter the results for Martinez:
Maryland: 587541
Delaware: 254871
Virginia: 633006
The results of a primary election between two candidates in three stare are:
Awbrey Martinez
Maryland: 645612 587541
Delaware: 304134 254871
Virginia: 734564 633006
Candidate Votes Percentage
Awbrey: 1684310 53%
Martinez: 1475418 47%
TOTAL VOTES: 3159728
Difficulty: High
Title: Time Conversion
Description:
Create a TimeConversion application that prompts the user for a time in minutes and then displays the time in hours and minutes.
Be sure to consider times when the number of minutes left over is less than 10 (for example 184 minutes should produce 3:04 in the hour:minute format). To do this use the same formula / strategy you used to figure out the Digits.
NOTE: I do not want to see anything fancy with conditionals or sub-string, etc.
Output:
Enter the time in minutes: 184
The time is: 3:04