Create a Business class: Instance variables: Student id 1000 - 9999 Student name Present Student email address Present Number of hours 3.5 - 18 Two constructors should be coded, one that accepts no arguments and sets every field to its default value, and one that accepts all four fields, and assigns the passed values into the instance variables. For each instance variable create two methods; a getter and a setter. Add a static method to the class that will accept the number of hours as an argument. In this static method, multiply the number of hours by 60.50 and return the result.
Create a Presentation class: The presentation class will ask the user to input information into the four fields listed above and validate those fields. That information will be passed over to the business class using the constructor. This class with be divided into methods and tested for valid data. Your presentation class will display all the values from the four fields listed above returned from the business class; along with the amount calculated from the static method.
Answer: Hello! Dear student, kindly find your solution here. This program is working well and error, giving the desired output. If you have any queries, feel free to ask me. Thanks.
import java.io.*;
//import packages
import java.lang.*;
import java.util.Scanner;
class Business
//create class
{
int Student_id;
//declare variables
String Student_name,email_id;
public static double Student_hours,result;
//static type variable for static
method
Business()
//defalut constructor to
assign defalut values
{
Student_id = 0;
Student_name = "XX";
email_id = "xxx";
Student_hours = 0.0;
}
Business(String name,int id,String email) //parametierized
contructor
{
Student_name = name;
Student_id = id;
email_id = email;
}
public static void Hours(double hours)
//static method
{
Student_hours = hours;
result = Student_hours*60.50;
}
public void get()
//getter method
{
System.out.println("Student name: "+Student_name);
System.out.println("Student ID: "+Student_id);
System.out.println("Student Email-Id: "+email_id);
System.out.println("Student Hours: "+Student_hours);
System.out.println("Result: "+result);
}
}
class Presentation //create presentation class
{
public static void main(String[]args)
{
String na,mail;
//variable declaration
double hrs;
int id;
Scanner in = new Scanner(System.in);
//call scanner for input
System.out. println("Enter Student Name:
"); //takes input for all
fields
na = in.nextLine();
System.out. println("Enter Student e-mail:
");
mail = in.nextLine();
System.out. println("Enter Student ID:
");
id = in.nextInt();
if(id>=1000 && id<9999) //validate
field
{
System.out.println("");
}
else
{
System.out.println("This is invalid Student ID!!");
//invalid data message
System.out.println("Try again!");
System.exit(0);
}
System.out. println("Enter Student Hours:
");
hrs = in.nextDouble();
if(hrs>3.5 && hrs<18)
//data
validate
{
System.out.println("");
}
else
{
System.out.println("This is invalid Student hours!!");
//invalid data message
System.out.println("Try again!");
System.exit(0);
}
Business b1 = new Business(); //call
defalut constructor
Business b2 = new Business(na,id,mail);
//call parametierized constructor
b2.Hours(hrs);
//call methods
b2.get();
}
}

Create a Business class: Instance variables: Student id 1000 - 9999 Student name Present Student email...
You are to create a class Appointment.java that will have the following: 5 Instance variables: private String month private int day private int year private int hour private int minute 1 default constructor public Appointment() 1 non-default constructor that accepts arguments for all instance variables, your constructor must call the setter methods below to set the values of the instance variables public Appointment(String monthPassed, int dayPassed, int yearPassed, int hourPassed, int minutePassed) 5 setter methods (one for each instance variable)...
Student class: Instance variables name id Constructors: Default constructor Constructor that has id and name passed to the constructor Methods: Accessors int getID( ) String getName( ) Class Roster: This class will implement the functionality of all roster for school. Instance Variables a final int MAX_NUM representing the maximum number of students allowed on the roster an ArrayList storing students Constructors a default constructor should initialize the list to empty strings a single parameter constructor that takes an ArrayList<Student> Both...
Write an abstract class “Student” and three concrete classes, “UnderGrad” and “Graduate” both inherit from Student and “PostGraduate” that inherits form “Graduate”. Write the class definition for the abstract class “Student”. The class definition should include private instance variables of type String to hold the student’s first name, a string for his/her major and an int to hold the number of units taken. Getter and setter methods for each of the variables should be included in the class definition. Also...
a) Create an abstract class Student. The class contains fields for student Id number, name, and tuition. Includes a constructor that requires parameters for the ID number and name. Include get and set method for each field; setTuition() method is abstract. b) The Student class should throw an exception named InvalidNameException when it receives an invalid student name (student name is invalid if it contains digits). c) Create three student subclasses named UndergradStudent, GradeStudent, and StudentAtLarge, each with a unique...
Write a class called Student. The specification for a Student is: Three Instance fields name - a String of the student's full name totalQuizScore - double numQuizesTaken - int Constructor Default construtor that sets the instance fields to a default value Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value. Methods setName - sets or changes the student name by taking in a parameter getName - returns...
Create a class called Retangle.java that contains two double-precision instance variables named width and height. The class should include all kinds of overloaded constructors. Additionally, there should be two accessor methods, mutator methods, class method named area() that returns the area of a Rectangle object. Inside main(),fully test all methods.
Design and implement a class called Flight that represents an airline flight. It should contain instance data that represents the airline name, flight number, and the flight’s origin and destination cities. Define the Flight constructor to accept and initialize all instance data. Include getter and setter methods for all instance data. Include a toString method that returns a one-line description of the flight. Create a driver class called FlightTest, whose main method instantiates and updates several Flight objects.
PYTHON*************** Create a Person Class that: Accepts First Name, Last Name, Age, and Gender Has a method that adds all persons Validate all input, not left empty for First Name, Last Name, Gender and numeric for age and throw an exception if it does not validate within the class. Create a Student Class that: Inherits the Person Class Accepts GPA Validate GPA (>= 0 and <= 4.0) and throw exception if it does not validate within the class. Has methods...
In Java For the following questions, “define a class” means the following: • Create an appropriately-named file containing the Java class definition, including the following: – A block comment describing the file (and hence the class), as always – Any instance variables, as required by the question – Accessor (getter) and mutator (setter) methods for any instance variables – Constructors as appropriate or as required by the question – A toString method that prints instances of the class informatively –...
Create a class called Student. This class will hold the first name, last name, and test grades for a student. Use separate files to create the class (.h and .cpp) Private Variables Two strings for the first and last name A float pointer to hold the starting address for an array of grades An integer for the number of grades Constructor This is to be a default constructor It takes as input the first and last name, and the number...