answer.
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
Virty [35]
2 years ago
9

Given 4 integers, output their product and their average, using integer arithmetic.

Computers and Technology
1 answer:
solmaris [256]2 years ago
8 0

Answer:

see explaination

Explanation:

Part 1:

import java.util.Scanner;

public class LabProgram {

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int num1;

int num2;

int num3;

int num4;

int avg=0, pro=1;

num1 = scnr.nextInt();

num2 = scnr.nextInt();

num3 = scnr.nextInt();

num4 = scnr.nextInt();

avg = (num1+num2+num3+num4)/4;

pro = num1*num2*num3*num4;

System.out.println(pro+" "+avg);

}

}

------------------------------------------------------------------

Part 2:

import java.util.Scanner;

public class LabProgram {

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int num1;

int num2;

int num3;

int num4;

double avg=0, pro=1; //using double to store floating point numbers.

num1 = scnr.nextInt();

num2 = scnr.nextInt();

num3 = scnr.nextInt();

num4 = scnr.nextInt();

avg = (num1+num2+num3+num4)/4.0; //if avg is declared as a float, then use 4.0f

pro = num1*num2*num3*num4;

System.out.println((int)pro+" "+(int)avg); //using type conversion only integer part

System.out.printf("%.3f %.3f\n",pro,avg);// \n is for newline

}

}

You might be interested in
When you check to see how much RAM, or temporary storage you have available, you are checking your _____.
victus00 [196]

Answer: primary memory

5 0
2 years ago
The Tell Me feature also includes access to the _____ feature.
Ierofanga [76]

Answer:

the quick access toolbar can be customized to include additional commands such as. -"tell me what you want to do" box ... custom programs or additional commands that extend the functionality of a Microsoft office program ... in the open window. it also includes ribbon display options and control buttons that enable you to ...

Explanation:

7 0
2 years ago
Scenario 1: Richman Investments provides high-end smartphones to several employees. The value of each smartphone is $500, and ap
vfiekz [6]

Answer:

a). SLE =$37.5

b). ARO =75

c). ALE = $2,812.5

Explanation:

a).Single loss Expectancy (SLE) is starting point in determining the single loss of an asset that will occur and calculated this;

SLE = asset value * exposure factor.

Asset value =$500,

Exposure factor is simply the percentage of asset lost.

In this case out of 1000 phones, 75 were damaged or loss.

In percentage;

75 ÷ 1000 =0.075, 0.075×100=7.5%(exposure factor).

Therefore,

SLE = $500×7.5%= $37.5.

b). ARO - Annual Rate of Occurrence is the number of times a threat on a single asset is expected to occur in one year.

In the case the damage or loss occured in 75 devices in one year.

c). ALE - Annualized loss Expectancy is the product of SLE and ARO.

Therefore;

ALE = $37.5 × 75 = $2,812.5.

3 0
2 years ago
Use the drop-down menus to complete each sentence about the layers of the atmosphere.
REY [17]

Answer

Use the drop-down menus to complete each sentence about the layers of the atmosphere.  

If the Mesosphere did not exist, Earth might be destroyed by chunks of rock from space.

The Stratosphere is located 12 to 50 kilometers from Earth’s surface.

Both the Mesosphere and Troposphere get colder as altitude increases.

The ozone in the Stratosphere protects people from ultraviolet (UV) radiation.

The Themosphere has the highest temperature of any layer in Earth’s atmosphere.

u welcome

6 0
2 years ago
Read 2 more answers
After running the following pseudocode, what will the value of VARIABLE be? 1. Set value of VARIABLE to 5 2. Increase the value
Nutka1998 [239]

Answer:

10

Explanation:

you start with 5       5

you add 3                8

the variable is not odd so skip         8

the variable is even so add 1            9

the variable is odd so add 1              10

10

hope this helps <3

8 0
2 years ago
Other questions:
  • Mary can view the thumbnails of her presentation slides when she is creating the slides. Which element of the program’s interfac
    5·2 answers
  • Mark’s friends told him about an automated program that sends unsolicited messages to multiple users. Which type of program were
    11·2 answers
  • Richard uses Microsoft outlook as his email client. He wants to check whether he has received any new mail. Identify which key R
    12·1 answer
  • Consider an application that transmits data at a steady rate (for example, the sender generates an N-bit unit of data every k ti
    8·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
    7·1 answer
  • On the planet Sigma, robots excavate chunks of a very precious cristaline. These chunks can be divided into smaller part only on
    15·1 answer
  • Write a MATLAB function named lin_spaced_vector with two inputs and one return value. The first input will be a single real numb
    7·1 answer
  • A series of gentle often open-ended inquiries that allow the client to progressively examine the assumptions and interpretations
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!