PART B (20 MARKS) QUESTION 1 Given the following Sun and axiingiza subclasses are inherited from BreatVizinheres super c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

PART B (20 MARKS) QUESTION 1 Given the following Sun and axiingiza subclasses are inherited from BreatVizinheres super c

Post by answerhappygod »

Part B 20 Marks Question 1 Given The Following Sun And Axiingiza Subclasses Are Inherited From Breatvizinheres Super C 1
Part B 20 Marks Question 1 Given The Following Sun And Axiingiza Subclasses Are Inherited From Breatvizinheres Super C 1 (25.65 KiB) Viewed 8 times
PART B (20 MARKS) QUESTION 1 Given the following Sun and axiingiza subclasses are inherited from BreatVizinheres super class. Super class: SportVisionShopPS Attributes: String Sdsla double price: Behaviors: Default and normal constructor Accessor for all attributes public abstract double satBİEGRHAE(); //calculate the discount public String Ring Subclass: CyclingGleas Attributes: Exes String Behaviors: Default and normal constructor Accessor for all attributes public double sablisseurTE(); public String KRĒKFÍNA!); Details discount of Cushingsless are shown in the table below: Glass Type Transition Polarized Iridium Subclass: SwimmingGlass Attributes: char type: String style; //Retro or Modern //customer order number //price of the glass Behaviors: Default and normal constructor Discount (%) 0 10 20 Accessor for all attributes public double sabRiascunt(); //Transition, Polarized or Iridium 'A'- anti-fogging goggle or '3'- short-sighted goggle Type of goggle Anti-fogging (A) Short-sighted (S) //calculate the discount based on //glass type //calculate the discount based on //goggle type and style public String KRĒKzing(); Details discount of SwimmingGlass are shown in the table below: Style and discount Retro 7% 5% Modern 10% 7%
CONFIDENTIAL 3 a) Write the definition of method named salissent) that can calculate the discount of price for both subclasses based on the given information. b) Assume that the following array of object has been declared for SpectViedensherrs super class: CS/JULY 2022/C SC435 BrektVäzivoskeres!! axe.= new GreatVázároškerES, [10]; Using the concept of polymorphism, write the segment of program in application that can do the following tasks: (Assume that all required methods have been defined in super class and both subclasses) i) Calculate and display the total discount given for every Sxsinal and Eximin respectively. Count and display the number for every goggle type. StudKM Notepad File Edit Format View Help QUESTION 2 Given the following text file named studz.txt in Figure 1 that contains the recruitment data of athlete from FKM, UiTM. The data is comprised of students' name, gender, weight and height. Mohd Azam Awang, Male, 55, 1.68 Abdullah Zakaria, Male, 65,1.77 Marina Abdul Aziz, Female, 52,1.68 Abdul Sani Hassan, Male, 77,1.84 Nurul Izawani Haron, Female, 45,1.55 Muhammad Nabil Salleh, Male, 60,1.76 (10 marks) Figure 1: Sample of StudFKM.txt Write a complete Java program using File I/O operation that can perform the following tasks: a) Declare the related file involved. b) Read all records from text file named Stud FROM.txt in Figure 1 c) Write all records about female students whose weight is above 60 and height is below 1.6 into text file named Female.txt. d) Close all file streams in used. e) Use exception-handling operations to deal with possible file input-output error. (10 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply