Question: It is giving me error message how can i fix it? Project Phase 1 Online Course Registration System: This project will develop an online course

It is giving me error message how can i fix it?

Project Phase 1

Online Course Registration System: This project will develop an online course registration system that allows students to register for courses remotely and receive instant feedback on their registration status. The system will also provide administrators with the ability to manage courses, assign students to courses, and track usage statistics.

Declare Numeric Variables (follow the rules of naming variables)

Declare at least one constant

Welcome the user using a dialog box

Prompt the user to enter your INPUTS

Include at least one if/else if/ else condition

At least two mathematical calculations

A random number (do something meaningful with this)

Outputs (formatted cleanly)

must comment every requirement on this list, please

Add another feature you want to include that is not on this requirement list. Must be something NEW on you own.

Use confirm box to add a yes/no input

Add a comment at the top of you program with your name, the name of your project and a brief description of it's purpose.

NOTE: For each requirement, MUST include a comment that identifies which requirement # you are completing. This is so that I can find my code when I am studying . For Example:

//Requirement 1 Numeric Variables. int price = 0; int total = 0; double weight = 0.0;

Java code

1 // Purpose: Develop an online course registration system that allows students to register for courses remotely and receive instant feedback on their registration status. 2 //The system will also provide administrators with the ability to manage courses, assign students to courses, and track usage statistics. 3 //Requirement 1 - Declare Numeric Variables 4 5 import javax.swing.JOptionPane; 6 7 public class CourseRegistrationSystem { 8 9 public static void main(String[] args) { 10 11 final int MAX_COURSES = 5; //Requirement 2 - Declare at least one constant 12 13 int courseCount = 0; 14 String studentName; 15 int studentID; 16 int courseID; 17 18 String courseName; 19 20 boolean validRegistration = false; 21 int attempts = 0; 22 double totalCost = 0.0; //Requirement 23 24 //Requirement 3 - Welcome the user using a dialog box 25 26 27 JOptionPane.showMessageDialog(null, "Welcome to the Online Course Registration System!"); 28 29 studentName = JOptionPane.showInputDialog(null, "Please enter your full name: "); //Requirement 4 - Prompt the user to enter your INPUTS 30 studentID = Integer.parseInt(JOptionPane.showInputDialog(null, "Please enter your student ID: ")); 31 32 while (!validRegistration && attempts < 3) { //Requirement 5 - Include at least one if/else if/else condition 33 courseID = Integer.parseInt(JOptionPane.showInputDialog(null, "Please enter the course ID: ")); 34 courseName = JOptionPane.showInputDialog(null, "Please enter the course name: "); 35 double costPerHour = Double.parseDouble(JOptionPane.showInputDialog(null, "Please enter the cost per hour: ")); 36 37 totalCost += creditHours * costPerHour; //Requirement 6 - At least two mathematical calculations 38 courseCount++; 39 40 int response = JOptionPane.showConfirmDialog(null, "Do you want to add another course?", "Course Registration", JOptionPane.YES_NO_OPTION); //Requirement 7 - Add another feature you want to include that is not on this requirement list. Must be something NEW on you own.Use confirm box to add a yes/no input 41 42 if (response == JOptionPane.NO_OPTION) 43 { 44 validRegistration = true; 45 } 46 else if (courseCount == MAX_COURSES) 47 { 48 validRegistration = true; 49 JOptionPane.showMessageDialog(null, "You have reached the maximum number of courses allowed."); 50 } 51 attempts++; 52 } 53 54 averageCostPerHour = totalCost / courseCount; 55 56 String output = "Student Name: " + studentName + " " + 57 "Student ID: " + studentID + " " + 58 "Number of Courses Registered: " + courseCount + " " + 59 "Total Cost: $" + String.format("%.2f", totalCost) + " " + 60 "Average Cost per Hour: $" + String.format("%.2f", averageCostPerHour); 61 62 JOptionPane.showMessageDialog(null, output); 63 64 } 65 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!