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
Naily [24]
3 years ago
8

Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a

nd computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Sample Run 1
Computers and Technology
1 answer:
nika2105 [10]3 years ago
3 0

Answer:

import java.util.Scanner;

public class NumbersStats {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int pos = 0, neg = 0, count = 0, num;

       double total = 0;

       System.out.print("Enter an integer, the input ends if it is 0: ");

       while (true) {

           num = in.nextInt();

           if(num == 0) break;

           if(num > 0) {

               pos++;

           } else {

               neg++;

           }

           total += num;

           count++;

       }

       System.out.println("The number of positives is " + pos);

       System.out.println("The number of negatives is " + neg);

       System.out.println("The total is " + total);

       System.out.println("The average is " + (total/count));

   }

}

Explanation:

You might be interested in
ISO 400 is twice as sensitive and ISO 100 true or false
beks73 [17]

Answer:

Quite simply, when you double your ISO speed, you are doubling the brightness of the photo. So, a photo at ISO 400 will be twice brighter than ISO 200, which will be twice brighter than ISO 100.

Explanation:

ISO most often starts at the value of ISO 100. This is the lowest, darkest setting, also called the base ISO. The next full stop, ISO 200, is twice as bright, and ISO 400 is twice as bright than that. Thus, there are two stops between ISO 100 and 400, four stops between 100 and 1600, and so on.

4 0
2 years ago
* 8) Embedded operating systems are specialized software meant only to manage the
Ede4ka [16]

Answer:

True

Explanation:

Embedded operating systems are operating systems which supports hardware which is not a computer and allows the hardware to perform its task.

An example of a device with an embedded operating system is an SD card. The operating system on the card allows the card to be readable by the computer which its is plugged to.

Other examples of hardware with embedded systems are traffic lights, digital televisions, ATMs, point of sale (POS) and digital cameras.

3 0
2 years ago
When should students in a study session use flash cards to quiz one another?
Lina20 [59]

When drilling, students in a study session use flashcards to quiz one another. thus, Option B is the correct statement.

<h3>What do you mean by drill and practice?</h3>

The term drill and practice can be described as a way of practice characterized by systematic repetition of concepts, examples, and exercise problems.

Drill and exercise is a disciplined and repetitious exercise, used as an average of coaching and perfecting an ability or procedure.

Thus, When drilling, students in a study session use flashcards to quiz one another. Option B is the correct statement.

Learn more about drill and practice:

brainly.com/question/27587324

#SPJ1

4 0
2 years ago
Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an ana
Andrew [12]

Answer:

Data often has intrinsic value.

Explanation:

Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an analyzing it and data often has intrinsic value.

5 0
3 years ago
Ask the user to input their grade percentage (e.g. the use will enter 98 if they had an overall grade of 98% in their course) fo
Airida [17]

Answer:

In Python

def getpointValue(subject):

   if subject >= 75:        point = 4; grade = 'A'

   elif subject >= 60:        point = 3; grade ='B'

   elif point >= 50:        point = 2; grade = 'C'

   elif point >= 40:        point = 1; grade = 'D'

   else:        point = 0; grade = 'F'

   return point,grade

subjects= ["Accounting","Marketing","Economics","MIS"]

acct = int(input(subjects[0]+": "))

mkt = int(input(subjects[1]+": "))

eco = int(input(subjects[2]+": "))

mis = int(input(subjects[3]+": "))

acctgrade = getpointValue(acct)

print(subjects[0]+" Grade: "+str(acctgrade[1]))

mktgrade = getpointValue(mkt)

print(subjects[1]+" Grade: "+str(mktgrade[1]))

ecograde = getpointValue(eco)

print(subjects[2]+" Grade: "+str(ecograde[1]))

misgrade = getpointValue(mis)

print(subjects[3]+" Grade: "+str(misgrade[1]))

totalpoint = (acctgrade[0] + mktgrade[0] + ecograde[0] + misgrade[0]) * 3

gpa = totalpoint/12

print("GPA: "+str(gpa))

Explanation:

<em>The solution I provided uses a function to return the letter grade and the point of each subject</em>

<em>I've added the explanation as an attachment where I used comment to explain difficult lines</em>

<em />

Download txt
6 0
2 years ago
Other questions:
  • What microsoft operating systems started the process of authenticating using password and username
    14·1 answer
  • Write a program that asks the user for three names, then prints the names in reverse order.
    5·1 answer
  • How are modern computers different from eniac?
    5·1 answer
  • Which of the following is NOT one of the Big 3 Google Applications that we discussed?
    9·2 answers
  • To gain a competitive edge this year, the upper management of a global IT company has decided to focus on customer service, empl
    13·1 answer
  • Arctic Gear LLC. recently adopted a new ERP​ system, but quickly found that it​ wasn't a perfect fit with their existing procedu
    14·1 answer
  • According to chronology, arrange the steps that you need to take during the installation of a ram stick?
    13·1 answer
  • Please help.........​
    13·1 answer
  • Unit 2: Lesson 6 - Coding Activity 1
    10·1 answer
  • What happened to China and India after they modernized their workforces by providing more training and education?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!