473,804 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i need any help for a project!

hi i am a beginner in c++, i have a project to be done by few weeks.
This project is a maths help for kids!! it is supposed to ask the kid
how many problems the kid want and then show the problems and then the
kid has to answer it and then the program says if is right or wrong!!

i have half done by my self!!! i cant figure out one thing!! how do i
do for the program give the exactly number of problems that the kid
asked for!!! i have got the idea for that i am basically sure it is a
loop but i cant set it up!! Can someone help me?

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
int number, answer; //variables

cout<<"how many problems would like?"; //display the question
cin>>number;
srand(time(NULL ));
int j=1+(int) (12.0*rand()/(RAND_MAX+1.0)) ; // generate first
random number
int j1=1+(int) (12.0*rand()/(RAND_MAX+1.0)) ; // generate second
random number

cout<<"Question 1: What is "<<j<<" x "<<j1<<"?";// first question
cin>>answer;

if (answer==j*j1) //anser correct or
wrong
cout<<"Correct! "<<endl;
else
cout<<"No,"<<j< <" x "<<j1<<" is: "<<j*j1<<en dl;

system("PAUSE") ;
return EXIT_SUCCESS;
}

May 11 '06 #1
4 1505
beg_c++ wrote:
hi i am a beginner in c++, i have a project to be done by few weeks.
This project is a maths help for kids!! it is supposed to ask the kid
how many problems the kid want and then show the problems and then the
kid has to answer it and then the program says if is right or wrong!!

i have half done by my self!!! i cant figure out one thing!! how do i
do for the program give the exactly number of problems that the kid
asked for!!! i have got the idea for that i am basically sure it is a
loop but i cant set it up!! Can someone help me?
All those exclamation points make you seem hyperactive. Try to calm
yourself!!

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
int number, answer; //variables

cout<<"how many problems would like?"; //display the question
cin>>number;
srand(time(NULL ));
int j=1+(int) (12.0*rand()/(RAND_MAX+1.0)) ; // generate first
random number
int j1=1+(int) (12.0*rand()/(RAND_MAX+1.0)) ; // generate second
random number

for( int i=0; i < number; ++i )
{
cout<<"Question 1: What is "<<j<<" x "<<j1<<"?";// first question
cin>>answer;

if (answer==j*j1) //anser correct or
wrong
cout<<"Correct! "<<endl;
else
cout<<"No,"<<j< <" x "<<j1<<" is: "<<j*j1<<en dl;
}

system("PAUSE") ;
return EXIT_SUCCESS;
}


May 11 '06 #2
mlimber wrote:
beg_c++ wrote:
hi i am a beginner in c++, i have a project to be done by few weeks.
This project is a maths help for kids!! [...]

[...]


I should be involving kids in my excuses for not doing my homework
more often... How effective this was, unbelievable!
May 11 '06 #3
Victor Bazarov wrote:
mlimber wrote:
beg_c++ wrote:
hi i am a beginner in c++, i have a project to be done by few weeks.
This project is a maths help for kids!! [...]


[...]

I should be involving kids in my excuses for not doing my homework
more often... How effective this was, unbelievable!


You mean, you want to do it "for the children".
Isn't that one of those polotical "slogans" that
Clinton always went back to? I guess it worked
well for him, so why can't everyone else use it.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
May 11 '06 #4
Victor Bazarov wrote:
mlimber wrote:
beg_c++ wrote:
hi i am a beginner in c++, i have a project to be done by few weeks.
This project is a maths help for kids!! [...]


[...]

I should be involving kids in my excuses for not doing my homework
more often... How effective this was, unbelievable!


You mean, you want to do it "for the children".
Isn't that one of those polotical "slogans" that
Clinton always went back to? I guess it worked
well for him, so why can't everyone else use it.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
May 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2942
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
11
2122
by: Mark | last post by:
Hi, For the last 2 years I've been developing vehicle tracking/telemetric software for a company as a self employed individual. The project is quiet big, and is going to be there flagship product. Since I had no other work at the time, I agreed to a low rate when I first started which was £100 a day. The project started small, so it was only going to be for a few months, and I badly needed the money. The project soon balooned into...
10
2891
by: Tom | last post by:
I am looking for some ideas for how to design the layout of the form for data entry and to display the data for the following situation: There are many sales associates. A sales associate can work for multiple companies and work for multiple divisions within each company. Within each division he can work in multiple departments and within each department he can work with multiple groups. In each group he works on multiple projects. All the...
48
3255
by: Chad Z. Hower aka Kudzu | last post by:
A few of you may recognize me from the recent posts I have made about Indy <http://www.indyproject.org/indy.html> Those of you coming to .net from the Delphi world know truly how unique and "huge" Indy is both as a project, in support, development, and use. But Indy is new to the .net world. Indy is a HUGE library implementing over 120 internet protocols and standards and comes with complete source. Its an open source project, but not...
1
1092
by: steve | last post by:
oh the powers that be! my boss wanted me to include several .net project that i have created to a cvs repository that is unix based. he walked me through a client application called "eclipse" that creates a local cvs cache/revisions for commit. i was assured all would be well if i renamed by base project directory under visual studio project to another name, let eclipse create the cvs'd base project directory, then delete that directory...
12
5344
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
17
2545
by: Student | last post by:
Hi All, I have an assignment for my Programming language project to create a compiler that takes a C++ file as input and translate it into the C file. Here I have to take care of inheritance and operator overloading and virtual functions. I mean it should not hamper the C++ meaning. In frank and simple terms i need to implement a small C++ compiler in C++, and i want the intermediate representation to be C. Please help me in this....
15
4650
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
0
2093
by: garimaarora | last post by:
hi i am a beginner of c++ language and had tried to build a project in c++ language the project is throwing me set of exceptions and i need ur help if there is anybody who is interested in project handling i will be highly obliged with ur cooperation anybody hwo is interested can send me the mailing address so that i can sent the details of the project as soon as possible the project in on hotel management system there is no syntax error...
3
1353
by: shapper | last post by:
Hello, I am working on an ASP.MET MVC Web Application with NET 3.5 in VS 2008. I need to run some extra tasks on this project build so I download MSBuild from http://msbuildtasks.tigris.org/. I installed it but no new project type shows in my VS 2008.
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.