1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nordsb [41]
4 years ago
7

Write a class called (d) Teacher that has just a main method. The main method should construct a GradeBook for a class with two

students, "Jack" and "Jill". Jack’s grades on the three tests for the class are 33, 55, and 77. Jill’s grades are 99, 66, and 33. After constructing the GradeBook object, main should use the instance methods of the GradeBook class to determine the name of the student with the highest average grades. Print the name of this student on the screen.
Computers and Technology
1 answer:
podryga [215]4 years ago
8 0

Answer:

The java program is given below.

import java.util.*;

class GradeBook  

{

//variables to hold all the given values

static int m11, m12, m13;

static int m21, m22, m23;

static String name1, name2;

//variables to hold the computed values

static double avg1, avg2;

//constructor initializing the variables with the given values

GradeBook()

{

name1 = "Jack";

m11 = 33;

m12 = 55;

m13 = 77;

name2 = "Jill";

m21 = 99;

m22 = 66;

m23 = 33;

}

//method to compute and display the student having highest average grade

static void computeAvg()

{

avg1=(m11+m12+m13)/3;

avg2=(m21+m22+m23)/3;

if(avg1>avg2)

System.out.println("Student with highest average is "+ name1);

else

System.out.println("Student with highest average is "+ name2);

}  

}

//contains only main() method

public class Teacher{  

public static void main(String[] args)

{

//object created

GradeBook ob = new GradeBook();

//object used to call the method

ob.computeAvg();

}

}

OUTPUT

Student with highest average is Jill

Explanation:

1. The class GradeBook declares all the required variables as static with appropriate data types, integer for grades and double for average grade.

2. Inside the constructor, the given values are assigned to the variables.

3. The method, computeAvg(), computes the average grade of both the students. The student having highest average grade is displayed using System.out.println() method.

4. Inside the class, Teacher, the main() method only has 2 lines of code.

5. The object of the class GradeBook is created.

6. The object is used to call the method, computeAvg(), which displays the message on the screen.

7. All the methods are also declared static except the constructor. The constructor cannot have any return type nor any access specifier.

8. The program does not takes any user input.

9. The program can be executed with different values of grades and names of the students.

You might be interested in
George has to develop a website for his dad’s cycle shop. He wants to focus mainly on the products and wants the website to have
irakobra [83]

Answer:

The correct answer is letter "D": George should only add images that will highlight the products.

Explanation:

Grid formats are web pages designs that instead of portraying information display pictures arranged three by three (3x3) or four by three (4x3) grids so the web page user can select one of the images that is of interest and after clicking on it details of that subject will be on the screen.

In that case, as George is using a grid format for his father's shop website, he should only add images that after been clicked will bring u the content of the corresponding product.

3 0
3 years ago
What affect does the corona virus have the United States economy
Readme [11.4K]

Answer:

It can disturb the worldwide stock of products, making it harder for U.S. firms to take care of requests. It can likewise waylay laborers in influenced regions, diminishing work supply toward one side and on the other moderate the interest for U.S. items and administrations. The monetary interruptions brought about by the infection and the expanded vulnerability are being reflected in lower valuations and expanded instability in the money related markets. While the specific impact of the coronavirus on the U.S. economy is obscure and mysterious, obviously it presents colossal dangers. Corona will most legitimately shape monetary misfortunes through inventory chains, request, and budgetary markets, influencing business speculation, family unit utilization, and global exchange. The infection won't just influence supply, yet a few parts of the U.S. economy may likewise encounter decreases sought after—and enormous decreases in income—in light of the general consequences for the economy. More households are in debt and are not able to purchase the things they would normally purchase without a fixed budget

-Hope this helps

6 0
3 years ago
Which pane is used to modify the actual content of the SmartArt graphics as opposed to the layout and design?
Zigmanuir [339]
Text i belive thats the answer
7 0
3 years ago
Discuss what technologies you might see in use at an enterprise. For example, where would you most likely see fiber-optic Ethern
kvv77 [185]

There are various connectivity technologies that we use to connect. They are Ethernet, Internet (Wireless Connection), Bluetooth, Wi-Fi and Cellular.

Explanation:

  • Ethernet is the direct connection among the devices that are located close to each other in a building. This is used for small scale enterprises.
  • Wi-Fi lets wireless connections among multiple devices without any physical connection. And it is most extensively used in most of the corporate companies.
  • Bluetooth is used to transfer the data from one device to the other when they are near.
  • Cellular is used to connect people across the globe. And it is used widely in every enterprises.
7 0
3 years ago
PLEASE HELP ME !!!!
Sedaia [141]

Answer:

Complete the ZipZapZop()

function so that it requests an integer from the user. The function should display a response following this pattern:

• Divisible by 3: zip

• Divisible by 5 zap

• Divisible by 7 zop

Otherwise, just display the number

Note 1 numbers that are divisible by more than one (3, 5, or 7) should contain

all applicable terms.

Notes 2 Note that you are displaying directly from this function, not returning a value to the calling function.

Hint: The number only prints if it is not divisible by ALL of 3,5,or 7

Explanation:

3 0
3 years ago
Other questions:
  • What are two parts of a cell reference?
    7·1 answer
  • In order for two computers to communicate via the internet, they must first locate one another. How do computers locate one anot
    12·1 answer
  • Keion works as a freelancer creating websites and designing logos for clients. He recently had a hard drive failure and lost wor
    12·1 answer
  • Aaron has elaborate systems set up on his computer to remind him of all the things he has to do and when he has to do them. The
    12·1 answer
  • In cell e9, enter a formula that calculates the session fee for a member. members receive a member discount off the non-member s
    9·1 answer
  • The ________ component of the five-component framework of an information system includes individuals who maintain the data and s
    5·1 answer
  • Describe how computer become <br> in the next 35 year
    5·1 answer
  • Https://intro.edhesive.com/courses/17288/assignments/2313298?module_item_id=4864185
    9·1 answer
  • To play a sound during transitions select a sound from - - - - - - list​
    11·1 answer
  • If you delete search results, you will a. clear the history on the computer. b. delete files from our computer. c. modify the re
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!