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
Nat2105 [25]
3 years ago
6

Write a program that asks the user to input four numbers (one at a time). After the four numbers have been supplied, it should t

hen calculate the average of the four numbers. The average should then be displayed.
Computers and Technology
1 answer:
nika2105 [10]3 years ago
6 0

Answer:

<u>Output</u>

Enter first number:  

1

Enter second number:  

2

Enter third number:  

3

Enter fourth number:  

4

Average: 2.5

Explanation:

Below is the java program to calculate the average of four numbers:-

import java.util.Scanner;

public class Average {

public static void main(String[] args){

 int a,b,c,d;

 double average=0.0;

 Scanner s=new Scanner(System.in);

 System.out.println("Enter first number: ");

 a=s.nextInt();

 System.out.println("Enter second number: ");

 b=s.nextInt();

 System.out.println("Enter third number: ");

 c=s.nextInt();

 System.out.println("Enter fourth number: ");

 d=s.nextInt();

 average=(a+b+c+d)/4.0;

 System.out.println("Average: "+average);

}

}

You might be interested in
A frameset should only be used with XHTML true or false
Naddik [55]
Framesets require a special DTD. If you're writing XHTML and want to use the strict DTD, you can't use frames/framesets.
4 0
3 years ago
Hey Yo, i need some help, Whats 2+2?
Goryan [66]

Answer:

4

Explanation:

4 0
3 years ago
Read 2 more answers
5.19 LAB: Countdown until matching digits Write a program that takes in an integer in the range 20-98 as input. The output is a
elena55 [62]

Answer:

Following are the code to this question:

x = int(input())#defining a variable x for user input value  

if(x>=20 and x<=98):#defining an if block that checks value is in between 20 to 98  

   while(not(x%10==x//10)):#defining while loop that seprate numbers and checks it is not equal  

       print(x)#print value

       x-=1# decrease value by subtracting 1

   print(x)# print value

else:#defining else block  

   print("The input value must lie in 20-98")#print message

Output:

36

36

35

34

33

Explanation:

  • In the above python program code, a variable x is declared, which is used to input the value from the user end.
  • In the next step, a conditional statement is used in if block, it checks the input value is lie in 20 to 98, and to check its uses and logic date, if it is false it will goto else section in this, it will print a message.
  • If the given value is true, inside if block a while loop is declared, that separately divide the value and check it is identical or not, if it is not identical it will print the value and checks its less value similarly.
3 0
4 years ago
What is the full form of ARPANet, WAN,FTP,DCP,HTML,ISP and last WWW​
Lapatulllka [165]

Advanced Research Projects Agency Network,

wide area network

File Transfer Protocol

?

Hypertext Markup Language

Internet service provider

world wide web

6 0
3 years ago
Read 2 more answers
Two Technicians are discussing ShopKey Pro. Technician
Vlada [557]

Answer:

Technician A is correct

Explanation:

Contact us is the most common term used in online applications such as in websites, mobile/android application to search contact information. People mostly scanning the “contact us” page to find the contact information, if they want to contact the company or organization.

Why technician A is correct.

Technician A is correct because people always try to find the “Contact us” page to find contact information for asking questions, to provide feedback, or any suggestion if they want to provide. It is hard for people to find contact information to provide feedback or give an idea to improve the ShopKey version in “support” heading under the “help” section. Because people are more inclined to search such information in the “Contact us” page rather than exploring the website to find such contact.

Why technical B is not correct

When people want to provide feedback, ask a question or suggest a new idea, they mostly prefer to search for information in the contact us pages. An ordinary user, who has no knowledge of website management or website hierarchy, search contact information in the “Contact us” page rather than searching in support or in the help section.

3 0
3 years ago
Other questions:
  • What is print media?
    14·1 answer
  • Which of the following is NOT an example of a font style?
    13·1 answer
  • How do u beat sonic unleashed
    8·1 answer
  • A computer technician has successfully returned a laptop to full operation and verified system functionality. Actions the techni
    9·1 answer
  • You need to deploy a new cloud-based windows intune deployment to manage mobile devices in your organization. drag and drop the
    5·1 answer
  • Sandra wants to have her new technology up and running as soon as possible. She is looking for a tool that she can
    8·1 answer
  • TRUE OR FALSE! A query can have no more than three common interpretations.
    10·1 answer
  • Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write yo
    9·1 answer
  • #Write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##The list
    11·1 answer
  • A vending machine that serves coffee pours a varying
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!