subject

Assignment #2 will be the construction of a program that reads in an unspecified number of integers from standard input, performs some calculations on the inputted numbers, and outputs the results of those calculations to standard output. The numbers could be delimited by any kind of whitespace, i. e. tabs, spaces, and lines (Note that if you use the Scanner class, you do not have to worry about these delimiters. They will be taken care of by the Scanner). Your program will continue to read in numbers until the number 0 is entered. At this point, the calculations will be outputted in the following format: The minimum integer is 0 The sum of the positive integers is 0 The sum of the even integers is 0 The number of negative integers in the sequence is 0 This means that your program reads all numbers (including the last number 0), you need to compute the minimum, the sum of positive integers (integers that are greater than 0), the sum of even integers (integers that can be divided by 2, you can use "number%2 == 0"), and count how many negative integers (integers that are less than 0) in the sequence. Note that the above is an output for the first test case. For other test cases, you will have different numbers. Do not output a prompt to query for the numbers. The number 0 is included in the sequence of integers and should be included in all of your calculations.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
True or false when a host gets an ip address from a dhcp server it is said to be configured manually
Answers: 1
You know the right answer?
Assignment #2 will be the construction of a program that reads in an unspecified number of integers...
Questions
question
Mathematics, 06.07.2020 14:01
question
Mathematics, 06.07.2020 14:01
question
Geography, 06.07.2020 14:01
question
Mathematics, 06.07.2020 14:01
question
Mathematics, 06.07.2020 14:01
question
Mathematics, 06.07.2020 14:01
question
English, 06.07.2020 14:01
Questions on the website: 13722367