Question: copying from the Internet. You may use your notes, book and the Internet to look up information. Students may occasionally be interviewed to demonstrate their
copying from the Internet. You may use your notes, book and the Internet to look up information. Students may occasionally be interviewed to demonstrate their knowledge of the code they have written. Create your lab using the name lab# firstname lastname, substituting the lab number in for # Objectives Declare the instance data in the class Write the constructor for the class Write method(s) for the class Write toString() method for the class - Add a new class file to your project - Create an object from the class n your driver (main) -Call the Class methods with and without parameters Grades -Demonstrate how to use DecimalFormat class for a double examt -double exam2 formatting output Instructions + Grades ovoid setexam1 (double ex) O +void setExam2(double ex) Write a program that does the following: 1) Create a class caled Grades String toString0 a) Define the following private Instance Data for the dass i) double exam1 i) double exam2 b) Create a Constructor that initializes exam1 and exam2 to 0.0 c) Write the setexam1 and setExam2 methods to modify the values exam1 and exam2 d) Write the toString method as described in class and on slide 34 of chapter 4 slides. i) Format exani and exam2 for 1 significant dig/t In main method a) Create an instance of the Grades class b) Call the set methods for exam1 and exam2 c) call the toString method to output the instance variables 2) 3) Example Output Exam1: 88.0 Exam2: 95.0 1/31/2019 Page 1 of 1 CSI 2300, Dinsmoor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
