Question: 5.1 Count positive and negative numbers and compute the average of numbers Write a program that reads an unspecified number of integers, determines how many
5.1 Count positive and negative numbers and compute the average of numbers Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and 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. Here is a sample run:
Enter an integer, the input ends if it is 0: 1 2 -1 3 0 [Enter] The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.25
Text Sections 5.8-5.10 5.15 Display the ASCII character table) Write a program that prints the characters in the ASCII character table from ! to -. Display ten characters per line. The ASCII table is shown in Appendix B of the text or can be found through an internet search. Characters are separated by exactly one space.
5.19 Display numbers in a pyramid pattern Write a nested for loop that prints the following output:
1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 1 1 2 4 8 16 32 16 8 4 2 1 1 2 4 8 16 32 64 32 16 8 4 2 1 1 2 4 8 16 32 64 128 64 32 16 8 4 2 1
Comprehensive 5.27 Display leap years Write a program that displays all the leap years, ten per line, from 101 to 2100, separated by exactly one space. Also display the number of leap years in this period
5.34 Game: scissor, rock, paper Programming Exercise 3.17 gives a program that plays the scissor-rock-paper game. Revise the program to let the user continu-ously play until either the user or the computer wins more than two times than its opponent.
NEEDED ASAP PLEASE
PROGRAMMING LANGUAGE IS C++ JAVA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
