bkolfo4 Posted March 25, 2008 Report Share Posted March 25, 2008 (edited) Wish I would have seen this earlier. . I am pretty darn good with C++. Wrote all of the C++ programs for a friend's C class last semester This is very similar to what you need. . . // This program will ask the user for a number between 1 and 100. It will continue to ask // until the user provides correct input. It will then display the prime numbers up to the // number the user input. // problem number // course number // Name // email #include <iostream> using namespace std; int main () { bool prime_number=true; int user_input; // this loop will prompt the user for an integer between 1 and 100 do { // do while loop until the value entered is between 1 and 100 cout << "Please enter integer between 1 and 100:\n"; cin >> user_input; // get the users input if ((user_input < 1) || (user_input > 100)) //if input was invalid print error cout << "You entered an invalid number!\n\n"; } while ((user_input < 1) || (user_input > 100)); for (int i = 2; i <= user_input; i++) { for (int j = 2; j < i; j++) { if (i % j == 0 ) prime_number=false; } if (prime_number) cout <<"Prime Number: " << i << "\n"; prime_number=true; } return 0; // exit program } PM me for the next one and I will see if I have anything already written up I could send you. . . Brian Edited March 25, 2008 by bkolfo4 Quote Current system: 1997 Blazer - (4) Customer Fi NEO subs with (8) American Bass Elite 2800.1s Previous systems: 2000 Suburban - (4) BTL 15's and (4) IA 40.1's = 157.7 dB at 37 Hz. 1992 Astro Van - (6) BTL 15's and (6) IA 40.1's = 159.7 dB at 43 Hz. Link to comment Share on other sites More sharing options...
Slinky Posted March 25, 2008 Author Report Share Posted March 25, 2008 i will be pm ing you sometime today probably Quote DD M4 Rockford Fosgate P500-4 SoundQubed HDC415 w carbon fiber cap 2 Rockford Fosagate T1675-S XS Power D3400 Under Hood XS Power D5100 in rear Michael Singer 200A Alt Build Log: http://www.stevemeadedesigns.com/board/topic/153901-2012-veloster-update-842013-wall-build-4-15s/ Link to comment Share on other sites More sharing options...
Dale Posted March 26, 2008 Report Share Posted March 26, 2008 At my school, They start you off with VB, then C++, THEN JAVA. After, you move into things like LISP, Prolog and such Quote Link to comment Share on other sites More sharing options...
KWP369 Posted March 26, 2008 Report Share Posted March 26, 2008 shit i'm a senior in high school and i'm taking java right now for my Computer science class... pretty easy in my opinion just a shit load of memorization Quote Do you read ur own response b4 you post?...or just type ur gut reaction and headbutt the enter key? How bout this, the Caddy sounds so damn good it can put a smile on a "deaf mans" face mat then mix hardener into resin and soak mat. beeeeeyaw glassing for n00bs Link to comment Share on other sites More sharing options...
Nickvb6 Posted March 26, 2008 Report Share Posted March 26, 2008 (edited) I like vb6.0 better then c++ vb6.0 is easyer i thank Edited March 26, 2008 by Nickvb6 Quote Link to comment Share on other sites More sharing options...
Dale Posted March 26, 2008 Report Share Posted March 26, 2008 I like vb6.0 better then c++ vb6.0 is easyer i thank it is somewhat easier. i think what makes C++ a little more difficult is that it lets you control system memory directly via the use of pointers. but that also makes it more powerful than vb in that respect. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.