Purchase Solution

C++ program showing a for loop

Not what you're looking for?

Ask Custom Question

1. Display a prompt on the command line and accept one interger as input

2. Call a function tha outputs seven sequential intergers, with the input interger as the middle item on the command line below the input prompt.

3.If the lowest of the seven intergers is greater than zero, output the line "all non-negative intergers" on the next line after the list of numners

4. If the lowest of the seven intergers is greater then zero, out put the line "all postive intergers" on the next line

Purchase this Solution

Solution Summary

This solution demonstrates a for loop in C++.

Solution Preview

A programming problem like this one can be broken into two major
steps: read the data, process the data. There is only one data item
that is read in and that is the integer provided by the user. This is
done with the following lines:

<pre>
// Get the number
cout << "Enter an integer: ";
cin >> num;
</pre>

All of the processing of the data is done in a ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.