Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using basic c++ write a separate code for the following problems. 1. Repeat Additions Generate 2 random integers and ask the user to input the

Using basic c++ write a separate code for the following problems.

1. Repeat Additions

Generate 2 random integers and ask the user to input the correct added value of 2 integers. Try to generate 10 questions randomly. Display the correct count. the If the answer is wrong display the correct answer with a comment, Your answer is wrong.

Output: What is 15 + 2? 7

Your answer is wrong. 15 + 2 should be 17

What is 15 + 14? 29

You are correct!

What is 12 + 12?

Correct count is 1

2. Count the positive and negative numbers while loop

Write a program that reads unspecified number of integers , determines how many negative and positive values have been read. Also calculate total and average. Your program will end with input 0.

Output

Enter an integer, the input ends if it is 0: 25 34 -89 72 -35 -67 21 48 0

The number of positives is 5

The number of negatives is 3

The total is 9

The average is 1.125

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions

Question

1. What are Associations ?

Answered: 1 week ago

Question

1. What is socialization?

Answered: 1 week ago

Question

1. State how schools help in socialization?

Answered: 1 week ago

Question

What are the major medium of communication ?

Answered: 1 week ago

Question

What techniques are used to capture the readers attention?

Answered: 1 week ago

Question

What reader benefits are included?

Answered: 1 week ago

Question

Are emotional appeals ethical? Why or why not? [LO-4]

Answered: 1 week ago