[Solved] 2031 Le 71 Lab Day Due D M 4 22 19 Sections 001 002 003 Purpose Learn Create Class Instant Q37188081


IS 2031: LE 7.1 Lab Day DUE D M 4/22/19 Sections 001, 002, 003 Purpose: To learn how to create a class, instantiate an object of the class in another class, and use that object to call methods. Prop Work: Read chapter 7. Refer to coding created or reviewed in your IS 2033 class. Lab Exercise 7.1 Instructions: Name your program as YourLastNameFirstinitialLE71 java. From the code in LE 6.2, do the following: 1. You will NOT be changing any of the logic in the code for LE 6.2 2. Create a separate class called Invention. This class will have NO main(). 3. Insert a default constructor in the Invention class. This is a method that is empty and its header looks like this: public NameOfClass( 4. Code an overloaded constructor that will receive a student’s name, when an object for Invention is created in the main(0 a. In the Invention class store the student’s name in a field (global variable) called studentAuthor b. You will insert the student’s name in the header of the output 5. Except, for the main), take all the other methods in LE 6.2 and put them in the Invention class. 6. Transfer the fields (class variables) from LE 6.2 to Invention. 7. Strip the word static from the fields and the method headers in the Invention class. 8. Cut and paste the main() from LE 6.2 into your program file for LE 7.1. a. Create an object of the Invention class. Format: NameOfClass objectName= new NameOfClass(“NameOfStudent) b. Use that object for the method calls in the main(). i. i. Format: objectName.methodName) 9. Make sure both classes are in the same directory 10. To run both programs, you must run the class with the main(). Grading Reauirements: During lab class, enter your name on the sign-up sheet for grading when your assignment is in gradable condition. cswebdav/pid 3-dt-forum-rid-61474930, -11277 courses/ISA 201920/Chapter%20 SAMPLE OUTPUT**** How many inventors? 3 Enter inventor #1: Thomas Edison Enter inventor #2: Alexander Graham Bell Enter inventor #3: George Washington Carver Enter Thomas Edison’s invention: Tin Foil Phonograph Enter Alexander Graham Bell’s invention: Telephone Enter George Washington Carver’s invention: Pomade from Peanuts Enter the year in which the tin foil phonograph was invented: 1877 Enter the year in which the telephone was invented: 1876 Enter the year in which the pomade from peanuts was invented: 1925 FAMOUS INVENTIONS Report By: Sarah Farrow Inventor: Thomas Edison Invention: Tin Foil Phonograph Year Invented: 1877 Inventor: Alexander Graham Bell Invention: Telephone Year Invented: 1876 Inventor: George Washington Carver Invention: Pomade from Peanuts Year Invented: 1925 Show transcribed image text IS 2031: LE 7.1 Lab Day DUE D M 4/22/19 Sections 001, 002, 003 Purpose: To learn how to create a class, instantiate an object of the class in another class, and use that object to call methods. Prop Work: Read chapter 7. Refer to coding created or reviewed in your IS 2033 class. Lab Exercise 7.1 Instructions: Name your program as YourLastNameFirstinitialLE71 java. From the code in LE 6.2, do the following: 1. You will NOT be changing any of the logic in the code for LE 6.2 2. Create a separate class called Invention. This class will have NO main(). 3. Insert a default constructor in the Invention class. This is a method that is empty and its header looks like this: public NameOfClass( 4. Code an overloaded constructor that will receive a student’s name, when an object for Invention is created in the main(0 a. In the Invention class store the student’s name in a field (global variable) called studentAuthor b. You will insert the student’s name in the header of the output 5. Except, for the main), take all the other methods in LE 6.2 and put them in the Invention class. 6. Transfer the fields (class variables) from LE 6.2 to Invention. 7. Strip the word static from the fields and the method headers in the Invention class. 8. Cut and paste the main() from LE 6.2 into your program file for LE 7.1. a. Create an object of the Invention class. Format: NameOfClass objectName= new NameOfClass(“NameOfStudent) b. Use that object for the method calls in the main(). i. i. Format: objectName.methodName) 9. Make sure both classes are in the same directory 10. To run both programs, you must run the class with the main(). Grading Reauirements: During lab class, enter your name on the sign-up sheet for grading when your assignment is in gradable condition.
cswebdav/pid 3-dt-forum-rid-61474930, -11277 courses/ISA 201920/Chapter%20 SAMPLE OUTPUT**** How many inventors? 3 Enter inventor #1: Thomas Edison Enter inventor #2: Alexander Graham Bell Enter inventor #3: George Washington Carver Enter Thomas Edison’s invention: Tin Foil Phonograph Enter Alexander Graham Bell’s invention: Telephone Enter George Washington Carver’s invention: Pomade from Peanuts Enter the year in which the tin foil phonograph was invented: 1877 Enter the year in which the telephone was invented: 1876 Enter the year in which the pomade from peanuts was invented: 1925 FAMOUS INVENTIONS Report By: Sarah Farrow Inventor: Thomas Edison Invention: Tin Foil Phonograph Year Invented: 1877 Inventor: Alexander Graham Bell Invention: Telephone Year Invented: 1876 Inventor: George Washington Carver Invention: Pomade from Peanuts Year Invented: 1925
Expert Answer
Answer to IS 2031: LE 7.1 Lab Day DUE D M 4/22/19 Sections 001, 002, 003 Purpose: To learn how to create a class, instantiate an o… . . .
OR

