?
Solved

C++

Posted on 2000-04-08
10
Medium Priority
?
169 Views
Last Modified: 2012-05-05
I need to write a program that takes a number & produces the multiplication table up to the user specified number.
a) I must create a function named multiples that takes two numbers as input arguments and returns a void. The first argument is the number for which multiples are to be produced. The second argument is the number of multiples that should be produced. The function will print a line of multiples.
b) Finally, The main function should:
- prompt the user to enter a value.
- use a for or a while loop to step through the values from 1 through the user specified value.
- from the body of the loop, invoke the function created in step a to print a line of output.
I want to include al the variable declarations & the program must run.
I'm obviously brand new to this, but now that I'm retired, I thought it would be fun to learn! oops! I completely lost. Can anyone show me examples and guide me through this?
0
Comment
Question by:rtb8288
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 

Expert Comment

by:vinodkarande
ID: 2695894
Dont mind , but u should at least make some efforts from ur side.....
This is a Exchange-experts site....this site is basically concerned with exchanging opinions on ur incomplete work if ur facing some props.....

I think u should first start implementing the code.....and then ask for some advice if ur facing some props.

regards,
Vinod
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2695909
we don't do homework
if you have any problem with it ask a question or send us your code and tell us your problem
0
 
LVL 22

Expert Comment

by:nietod
ID: 2695910
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:RONSLOW
ID: 2696063
show us what you have so far (working or not).

here's a little starter if you've gotten absolutely nowhere

>a) I must create a function named multiples that takes two numbers as input arguments and returns a void. The first argument is the number for which multiples are to be produced. The second argument is the number of multiples that should be produced. The function will print a line of multiples.

void multiples (int base, int nmultiples) {
  ...
}

in the function start with multiple = base, then loop thru n-multiple times
each time multiplying multiple by base and outputing multiple using cout.

>b) Finally, The main function should:
>- prompt the user to enter a value.

easy .. write the prompt with cout << and input with cin >>

>- use a for or a while loop to step through the values from 1 through the user specified value.

for loop sounds best .. pretty obvious.

>- from the body of the loop, invoke the function created in step a to print a line of output.

not much there either.

Post your attempted code and wecan help with it.
0
 

Expert Comment

by:levkin
ID: 2735339
He-he Computer Science 101
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 200 total points
ID: 2743221
Well , i think I've helped enough.
0
 

Author Comment

by:rtb8288
ID: 2744195
RONSLOW'S HELP WAS SUPERB; ABOVE AND BEYOND THE CALL OF DUTY!
0
 
LVL 22

Expert Comment

by:nietod
ID: 2744493
Then you should grade his answer and close the question.
0
 

Author Comment

by:rtb8288
ID: 2744810
I've attempted to close the question; I've also attempted to remove myself from the EE list, both unsuccessfully. Please close the question & remove my email address from the list.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2744864
To close the question, select one of the grades (A-D) that you think RONSOW deserves.  Then press the submit button.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question