Share
Explore BrainMass

C++ Programming for Personal Information

Programming Assignment 7 - Arrays

Purpose: This assignment is designed to demonstrate your understanding of repetition structures with an unknown number of iterations as well as arrays.

Assignment:

Write a complete C++ program with jGrasp to do the following:
 Store the first 100 multiples of a user-supplied integer
 Print these values forward and backward from storage (in an array)
 Print any values that are multiples of a second user-supplied integer or a message indicating that there are no multiples of that number if that is so.
Save your program as multiples.cpp

Program 7 will be worth 100 points and will be assigned points as follows:
Program compiles 30 Points
Documentation
Header documentation (programmer info) 5 Points
Input
User prompted values 10 Points
Output
Personal Information (printed on monitor) 5 Points
Correctly printed output 25 Points
Storage
1 array only (and MUST create and use an array) 25 Points
Points will be deducted if you simply use a formula in a loop to print these values.
They must be stored in an array and printed from the array!
Total 100 Points

Attachments

Solution Preview

The multiples.cpp file takes in two numbers num1 and num2.
It first stores the first 100 multiples of num1 in an array called arr[].
It then shows these multiples using a for loop and by going through the array arr[] from index 0 to index 99 (Remember in ...

Solution Summary

The expert examines C++ programming for personal information. An array is created to deduct the loops to print.

$2.19