|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help with hw
Hi guys, first time NetBeans user and i am having difficulty with my HW assignment. So basically here it is
Write a program that reads in information from a student registering for a semester at UCF. The input to be read from the student is: first name, last name, student id number, semester and year (4 digit format) they are registering for, the classes they will be taking (4 classes), example COP 2250. Assume 3 credits per class with price per credit at $57.50. Your output should consist of the information entered by the student plus the following: total number of credits registered, total cost for credits registered, health insurance cost ($130.00), State Tax (12% of price per credit), Federal tax (6% of total cost for credits), County tax ($120.00), Local Tax (50% of (County tax + State tax)), and total amount due for the semester. Your output should resemble the following ****UCF REGISTRATION****** Name: Smith, John Student Number: 1297453 Semester: Summer 2006 Classes: COP 3343 ENC 1102 RMA 3320 TBS 3324 Total Credits: 12 Total Credit Cost: $690.00 Health Insurance: $130.00 Federal Tax: $41.40 State Tax: $6.90 County Tax: $120.00 Local Tax: $63.45 Total Amount Due: $1051.75 *****END OF STATEMENT****** So basically that is it and this is what i have done, Code:
/*
* Main.java
*
* Created on September 13, 2007, 10:58 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package johnsmith_ucf_reg;
import java.util.Scanner;
/**
*
* @author Smi
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String fname = " ";
String lname = " ";
String fullname = " ";
int Student_Number = 0;
double Registration_Semester = 0;
double Class_1 = 0 ;
double Class_2 = 0;
double Class_3 = 0;
double Class_4 = 0;
Scanner scan = new Scanner(System.in);
System.out.print("Enter first name: ");
fname = scan.nextLine();
System.out.print("Enter last name: ");
lname = scan.nextLine();
System.out.print("Enter Student Number: ");
Student_Number = scan.nextInt();
System.out.print("Enter Registration Semester: ");
Registration_Semester =scan.nextDouble();
System.out.print("Enter Class 1: ");
Class_1 = scan.nextDouble();
System.out.print("Enter Class 2: ");
Class_2 = scan.nextDouble();
System.out.print("Enter Class 3: ");
Class_3 = scan.nextDouble();
System.out.print("Enter Class 4: ");
System.out.println("End of Statement");
}
i know its not much and i could really use some help cause i am pretty new to this stuff, thanks |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Need help with hw |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|