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
In Python, what does this command do:<br>print ("\n")​
Svetradugi [14.3K]
It creates a new line
3 0
3 years ago
What's the biggest security issue with using social networking sites to market your listings?
Savatey [412]

The biggest security issue with using social networking sites to market your listings is Criminals may use social networking sites to identify your personal data.

<h3>What is a social marketing site?</h3>

A social marketing site is a site where people from around the world are connected in one place and share their thoughts and photos and other data.

The social sites are on the internet and there is a chance of stealing data and it identity theft, phishing, online predators, internet fraud, and other cybercriminal attacks are also some risks.

Thus, the largest security concern with using social networking sites to sell your listings is that thieves could use these sites to find personal information about you.

To learn more about social marketing sites, refer to the link:

brainly.com/question/15051868

#SPJ4

6 0
1 year ago
Please code in python and add comments to code
Gnoma [55]

#accepting input from user

n=int(input("Enter a number: "))

#entered number is stored in a temporary variable

temp=n

#initializng required variables

rev=0

dgt=0

#digits are reversed inside while loop

while(n>0):

dgt=n%10

rev=rev*10+dgt

n=n//10

#original number and its reverse are compared

if(temp==rev):

#if equal, it's a palindrome

print("It is a Palindrome")

else:

#if not equal, it's not a palindrome

print("It is not a Palindrome")

#◌⑅⃝●♡⋆♡Nåmřāthā♡⋆♡●⑅◌

4 0
2 years ago
"Write code that prints: Ready! countNum ... 2 1 Start! Your code should contain a for loop. Print a newline after each number a
BartSMP [9]

Explanation:

#include <iostream.h>

#inlcude<conion.h>

void main()

{

  int count, x;

  clrscr();

  cout<<"Enter the count:";

  cin>> count;

  cout<<"Ready!\n";

  for(x=count;x>0;x--)

  {

     cout<<x<<"\n";

  }

  cout<<"Start";

  getche();

}

This is a simple program where the output is expected to be in reverse order. So we run a for loop starting from the count and decrements the counter by 1 every time when the loop runs and print the value. So to print the output in "new line" we include "\n".

6 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
trasher [3.6K]

syntax are programming languages that specify a series of structured functions. C is an example of such a language.

7 0
3 years ago
Other questions:
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • Your motherboard supports dual channeling and you currently have two slots used in channel a on the board; each module holds 1 g
    15·1 answer
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Sample Run Enter a Number: 98 Sample Output
    7·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • A character with the point size of 10 is about 10/72 of once inch in height
    8·1 answer
  • What is the Slide Sorter View used for?
    12·2 answers
  • Which cable would you check if you can't access any web pages?
    12·1 answer
  • KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales f
    6·1 answer
  • Using a tag, set the color to orange for all tags
    13·2 answers
  • The best way to deal with crying children in the car is to ignore them or pull off the road
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!