Jump to content

Recommended Posts

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 by bkolfo4

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

i will be pm ing you sometime today probably

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

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

Do you read ur own response b4 you post?...or just type ur gut reaction and headbutt the enter key? :blink:

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

SMDsigbannr9.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Who's Online   0 Members, 0 Anonymous, 1491 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...