. Question(1) (1) Create class called square that has one instance variable (side) of type integer. a-...
Fantastic news! We've Found the answer you've been seeking!
Question:
.
Transcribed Image Text:
Question(1) (1) Create class called square that has one instance variable (side) of type integer. a- Include set(of type void) and get (of type integer) method for the side member. b- Include a method to calculate the area of the square. (2) Write a program that test the class created in part (1). Question(2) Create a class called Student to represent a Student exam grades. The class has 4 instance variables: A String variable for the first name, and three double variables that are used to store a student's exam grades. 1- Include a get and a set method for each of the instance variables in the class. 2- Include a getAverage method that calculates and returns the average of the three exam grades. 3- Write a separate program that creates three Student objects to hold the following data. Exam#1 | Exam#2 | Exam#3 First Name Ahmed 83.0 95.5 90.0 Kareema 75.25 83.0 89.0 Jassim 65.0 70.5 68.0 4- Output the name and average grade for each of the above students. Question(1) (1) Create class called square that has one instance variable (side) of type integer. a- Include set(of type void) and get (of type integer) method for the side member. b- Include a method to calculate the area of the square. (2) Write a program that test the class created in part (1). Question(2) Create a class called Student to represent a Student exam grades. The class has 4 instance variables: A String variable for the first name, and three double variables that are used to store a student's exam grades. 1- Include a get and a set method for each of the instance variables in the class. 2- Include a getAverage method that calculates and returns the average of the three exam grades. 3- Write a separate program that creates three Student objects to hold the following data. Exam#1 | Exam#2 | Exam#3 First Name Ahmed 83.0 95.5 90.0 Kareema 75.25 83.0 89.0 Jassim 65.0 70.5 68.0 4- Output the name and average grade for each of the above students.
Expert Answer:
Related Book For
Guide To Java A Concise Introduction To Programming
ISBN: 978-3031228414
2nd Edition
Authors: James T. Streib, Takako Soma
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Make a balance sheet for the following data- One Time Start-Up Costs: Rent Deposit $4,000 Furniture & Fixtures $8,000 Equipment $6,000 Buildout/ Renovations $10,000 Decorating, Painting and...
-
On November 1, 2015, Sokos Inc. accepted a three-month, 6%, $40,000 note from Malmo Inc. in settlement of its account. Interest is due on the first day of each month, starting December 1. Both...
-
The total payroll of Lyndon Inc. was $230,000. Income taxes withheld were $55,000. The EI rate is 1.83% for the employee and 1.4 times the employee premium for the employer. The CPP/QPP contributions...
-
You were engaged to examine the financial statements of Ronlyn Corporation for the year ended June 30. On May 1, the Co poration borrowed \(\$ 500,000\) from Second National Bank to finance plant...
-
With regard to accounting for private, not-for-profit health care entities, do the following: a. Outline the accounting required, under FASB guidance, for a(n): (1) Endowment gift received in cash....
-
A 0.045 kg green marble collides with a stationary 0.070 kg yellow marble. Before the collision, the green marble was moving with a speed of 3.1 m/s, but after the collision, the green marble had a...
-
AP Vianne is the management accountant for Divvy, a bike-sharing service in Chicago. She is trying to plan for summer activity by using the most recent ridership information provided. She needs to...
-
When leukocytes adhere to the endothelium of a blood vessel, they undergo an interesting rolling motion. This is caused by the flow of blood over the leukocyte and the force (F) binding the leukocyte...
-
Your company has been operating for five years and is involved in the design and creation of landscape garden areas for corporate clients. When the business started, you relied on a number of...
-
You work for a business that operates 58 snack food stalls located at railway stations, bus terminals, and other transport hubs. The business has been growing over the past three years but lacks...
-
You are a business consultant and offer help and advice to fledgling businesses. Two years ago, you were contacted by Mr. Boutros, a retired shopkeeper. He had passed his business on to his son Adnan...
-
Discuss some of the important arguments for and against making an apology for an organizational mistake.
-
Twitter updates are a great way to alert people to helpful articles, videos, and other online resources. Your task: Find an online resource (it can be a YouTube video, a PowerPoint presentation, a...
-
Pans divide-and-conquer matrix multiplication algorithm is based on a partitioning scheme that assumes n is a power of 70. The complexity T ( n ) of Pans divide-and-conquer algorithm satisfies the...
-
The population of Detroit, Michigan, decreased from 1,027,974 in 1990 to 688,701 in 2013 (Source: U.S. Census Bureau). Find the average rate of change in the population of Detroit, Michigan, over the...
-
Determine the output from the following code segment: int outer = 1; while (outer < 4) { int inner = 1; while (inner
-
Consider a program that reads data from an input file named in.dat, performs calculations, and outputs the results to a file named result. out. A. What would happen if the file in. dat did not exist...
-
Write a recursive method to multiply two positive integers using repeated addition.
-
At a given point on the airfoil surface with very low speeds, the pressure coefficient is 0.3. If the Mach number of the free stream is 0.6, then CP calculated at this point is?
-
A two dimensional airfoil is placed in the air so that its lowest pressure point appears on the lower surface. The pressure coefficient at this point is 0.782 when far field Mach number is 0.3. Try...
-
At low speed Incompressible flow, the pressure coefficient at a given point on the wing is 0.54. When the free flow Mach number is 0.58, by use of (1) Prandtl-Glauert law (2) Karman-Qian law (3)...
Study smarter with the SolutionInn App