Sale!

CSC 1302 Principles of Computer Science II Assignment 2: Writing Java Programs with Control

$30.00 $18.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (7 votes)

Purpose:
Flow of a program generally is implemented with three basic types of control structure:
– Sequential: executing statement one by one
– Selection: or decision making, used for decisions, branching, choosing between 2 or
more alternative paths to execute
– Repetition: used for repeating a set of instructions/functions multiple times while some
condition evaluates to be true.
In this assignment, we will refresh what we learned about decision making in java by using the
statements such as if, if-else, nested if-else. They are similar to decision making in real life.
Loop control statements such as while and do-while will allow a block of codes to be repeatedly
executed. The control statements will control the flow of the program’s execution.
Program #1:
In one state, single residents are subject to the following income tax:
Income Amount of tax
Not over $750 1% of income
$750-$2500 $7.5 plus 2% of amount over $750
$2500-$5000 $82.5 plus 4% of amount over $2500
$5000-$8000 $142.50 plus 5% of amount over $5000
Over $8000 $230.00 plus%6 of amount over $8000
Write a program named IncomeTax.java.
1. generate random number of people in the range of (1-15);
2. ask the user to enter the amount of taxable income for each person, and then
displays the tax due;
3. display the person with the highest tax value.
Program #2:
Write a program named RepeatedDigits.java that asks the user to enter a number to be tested for
repeated digits. For each input number from user, the program prints a table showing how many
times each digit appears in the number. Let’s assume that the appearance of a digit will not be
over 1000 times in the input. Make sure your table printout can align well.
The program should terminate when the user enters a number that is less than or equal to 0. A
sample output is as the following.
Criteria:
1. Upload all of the .java and the .class files to the CSc1302 dropbox on http://
icollege.gsu.edu.
2. Your assignment will be graded based on the following criteria: (a) Are your programs
runnable without errors? (b) Do your programs complete the tasks with specified outputs?
(c) Do you follow the specified rules to define your methods and programs? (d) Do you
provide necessary comments include the programmer information, date, title of the
program and brief description of the program.
3. Make sure that both the .java and .class files are named and uploaded to icollege
correctly. If any special package is used in the program, be sure to upload the package
too. Should you use any other subdirectory (whatsoever) your program would not be
graded, and you will receive a 0 (zero).
4. No copying allowed. If it is found that students copy from each other, all of these
programs will get 0.