Answer:
import java.util.Scanner;
public class num2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int count =0;
int total = 0;
System.out.println("Enter the numbers");
int num = in.nextInt();
while(num!=-1){
total = total+num;
count++;
System.out.println("Enter the next number");
num = in.nextInt();
}
//Compute the average
double average = (double) total/count;
//Outputs
System.out.println("Total count of numbers entered "+(count));
System.out.println("Sum of the numbers "+total);
System.out.printf("Average is %.2f ",average);
}
}
Explanation:
- Using java programming language
- Import scanner class to receive user input
- declare variables count and total and initialize to zero
- Prompt user to enter numbers
- Use a while statement with the condition while(num!=-1)
- Within the while body keep prompting user to enter a number, increase count and update total
- when -1 is entered the loop breaks and average is calculated
- Use printf() method to print average to 2 decimal places.
Answer: Scope resolution operator(::)
Explanation: A member function and the constructor can be called within the function easily but for the execution of the these components outside the class , a special operator is required to call the functions. The scope resolution operator(::) preceding with the name of class is thus used for defining of the function outside class.This operator maintains the cope of the function and constructor outside the class.
Answer:CPU stands for the central processing unit. CPU is not a peripheral device.
Explanation:
CPU stands for the central processing unit. CPU is not a peripheral device.
Which of the following is NOT one of the MOST common uses of Twitter? b . Making a business contact.
The answer is C: Enablement of application as SaaS.
A cloud can provide IT infrastructure network services like storage and servers. Once an application has been identified as a potential candidate for cloud migration, it is important to consider what type of cloud environment; PaaS, SaaS, or IaaS. In this case, SaaS will be considered. SaaS host business application and makes them available to clients online. It removes the need for enterprises to run applications on their own.