Question

In: Computer Science

[15 marks] Draw the flowchart of the following programming problem: You can draw the flowchart using...

[15 marks] Draw the flowchart of the following programming problem: You can draw the flowchart using a drawing tool, or draw the flowchart on a piece of paper, take a picture, insert it here or save it in the submission folder The program reads an unspecified number of integers until a zero is entered. While the program reads each number it counts the number of positive numbers and the number of negative numbers that have been entered and sum up the values of the numbers entered. After the user enters zero, the program computes the average of the input values, not counting the zero. At the end the program displays the average, and the counts of positive numbers and negative numbers

Solutions

Expert Solution

Here is the flowchart for the above problem. It is created using Flowgorithm.

NOTE:

n is the total number of numbers entered by the user, sum and avg are the variables used to store the sum and the avg, respectively. Also, the while loop terminates when the user enters 0, until when it keeps count of all the negative numbers entered and the positive numbers entered. At the end of the loop, we display the results.

Here is a working example for the same:


Related Solutions

6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
Write an algorithm and draw a flowchart for the following problem: Create an adaptive cruise control...
Write an algorithm and draw a flowchart for the following problem: Create an adaptive cruise control for a car. Include functions for enabling/disabling the cruise control; setting up the speed. The system should always maintain the speed unless there is a slower car in front of it. Make sure to define inputs and outputs. Do not forget that computer’s microprocessor works in very small steps (tiny steps!), so be careful not to assign large number of steps to one flowchart...
Draw a flowchart that will calculate the roots of a quadratic equation. (java) Can someone draw...
Draw a flowchart that will calculate the roots of a quadratic equation. (java) Can someone draw it for me? and at same time explain,
Develop an Algorithm and java program using Design Recipe for the following problems. Draw a flowchart...
Develop an Algorithm and java program using Design Recipe for the following problems. Draw a flowchart to compute the largest and smallest of 4 numbers : Write a Java Program for the above flowchart, use methods(functions), and nested if-else statements. Take input from the user using the Scanner object. Use separate methods to compute the Largest and Smallest of the numbers. Method 1 Name: findLargest(param 1, param 2, param 3, param 4) Method 2 Name: findSmallest(param 1, param 2, param...
Using the information given below draw and label a flowchart of the processes involved in production...
Using the information given below draw and label a flowchart of the processes involved in production of phthalic anhydride. Use boxes and/or other symbols to represent process units and lines with arrows to represent inputs and outputs. Indicate the process conditions. Phthalic anhydride (PA) is produced via partial oxidation of o-xylene using oxygen. The feed to the plant is o-xylene and air. Air is compressed to approximately 2 bar in a centrifugal compressor and heated to 360°C using high-pressure steam...
This problem will give you hands-on practice with the following programming concepts: • All programming structures...
This problem will give you hands-on practice with the following programming concepts: • All programming structures (Sequential, Decision, and Repetition) • Methods • Random Number Generation (RNG) Create a Java program that teaches people how to multiply single-digit numbers. Your program will generate two random single-digit numbers and wrap them into a multiplication question. The program will provide random feedback messages. The random questions keep generated until the user exits the program by typing (-1). For this problem, multiple methods...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will use the concept of object aggregation (i.e., has-a relationship between objects). You will implement a Java application, called MovieApplication that could be used in the movie industry. You are asked to implement three classes: Movie, Distributor, and MovieDriver. Each of these classes is described below. The Movie class represents a movie and has the following attributes: name (of type String), directorsName (of type String),...
Can you please solve this using recursion/ dynamic programming? Any programming language is fine. Wallace the...
Can you please solve this using recursion/ dynamic programming? Any programming language is fine. Wallace the Weightlifting Walrus is training for a contest where it will have to lift 1000 kg. Wallace has some weight plates lying around, possibly of different weights, and its goal is to add some of the plates to a bar so that it can train with a weight as close as possible to 1000 kg. In case there exist two such numbers which are equally...
Problem 1. For each of the following examples, draw a representative isoquant. What can you say...
Problem 1. For each of the following examples, draw a representative isoquant. What can you say about the marginal rate of technical substitution in each case? 1. A firm requires exactly two full-time workers to operate each piece of machinery in the factory. 2. A firm can hire only full-time employees to produce its output, or it can hire some combination of full-time and part-time employees. For each full-time worker let go, the firm must hire an increasing number of...
I am a student taking python programming. Can this problem be modified using the define main...
I am a student taking python programming. Can this problem be modified using the define main method, def main()? #Define showExspenses function def showExpenses(loan,insure,gas,oil,tyres,maintenance): expense=loan+insure+gas+oil+tyres+maintenance #Print monthly and yearly automobile operating expenses print("\nTotal Monthly expenses for operating expenses you entered = ",expense) print(f"\nTotal Yearly expenses for operating expenses you entered = 12 *",expense,f"= {expense*12:,}") #yearly expenses loan=int(input("Enter Loan :")) insure=int(input("Enter Insurance :")) gas=int(input("Enter Gas :")) oil=int(input("Enter Oil :")) tyres=int(input("Enter Tyres :")) maintenance=int(input("Enter Maintenance:")) showExpenses(loan,insure,gas,oil,tyres,maintenance)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT