Question: oop in java Q 100% QUESTION 1 (15 MARKS) 1. Determine the scope of the following: 1. For the class Account in Fig. QI()), a)

oop in java
 oop in java Q 100% QUESTION 1 (15 MARKS) 1. Determine
the scope of the following: 1. For the class Account in Fig.
QI()), a) Instance variable name b) Variable depositAmount (1 marks IL For

Q 100% QUESTION 1 (15 MARKS) 1. Determine the scope of the following: 1. For the class Account in Fig. QI()), a) Instance variable name b) Variable depositAmount (1 marks IL For the class ClassAverage in Fig. QI(1)), (2 marks) a) Variable gradeCounter b) Variable average (2 marks public class Account (2 marks) 2. private String name; Il instance variable private double balance; // instance variable Il Account constructor that receives two parameters public Account(String name, double balance) this.name-name// assign name to instance variable nom // validate that the balance is greater than 0.8; if it's not 12 // instance variable balance keeps its default initial value of e.. 13 If (balance > 0.0) // If the balance is valid 14 this.balance - balance; // assign it to instance vorable balance is } 16 17 1/ method that withdraws (deduct) only valid amount to the balance public void withdraw(double withdrawal Amount) 19 C 2 If (withdrawal Amount 0.0) // if the depositamount is valid balance - balance + depositAmount; // add it to the balance } 35 36 37 38 39 40 method returns the QCCOUNT balance public double getBalance() return balance; // method that sets the name public void setName(String name) C this.name = name; 65 mi System.out. name: Assance: SATA.getamet). BecaLance 56 57 11 and class Account Fig. QI(1) (1) 1.1 Classe 2 Solving the classverge role wing counter-controlled to 3 mort Sava.util.Scanner processer 4 $blic class ClassAverage . 7 puolte static void main(String *91) 1 create scanner to obtain it from comand wow 10 Scanner input Scanner Systen.no T 12 initiation has 13 In totalitate of entered the 14 in gradeCounter-inito de todox 15 processing phases Counter-controlled petit 17 while (grade Counter 10) to the 18 10 System.out.print("Enter" Intrade frout.nextInOuterade 21 total total grade grade to 22 gradeCounter - gradeCounter Inch counter 23 24 Het phase int average - total 10 stod internet 27 Way total and we 29 System.out.printl of 1 10 total) A 30 System.out.print(" Calaverage) 31 32 )and class Cle Enter grade 67 Enter grades Enter grade: Enter grader 67 Enter ordet 87 Enter grade Enter grader Enter ordet 15 Enter Orades 2 Enter grade 100 Total of 10 grades s 846 Class average 4.3 Solving the stage grobem uning counter controlled repetition (Part 2) Fig. Qi(1)()

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!