# HELP! My son has to pass this class to graduate!

Discussion in 'Mac Basics and Help' started by Desperatemom, Mar 27, 2011.

1. ### Desperatemom macrumors newbie

Joined:
Mar 27, 2011
#1
My son is a senior and he needs to pass his C++ programming class to graduate in June. The quarter ends next week and he has to do 5 assignments and turn them in to have a shot at not failing the 3rd quarter.

I need a SIMPLE C++ compiler for Mac that does not expect much in the way of actual understanding of what you are doing.

1. Write a program to average a number of test scores. Input the number fo test scores you would like to be averaged. Then inside a for loop input each score.

2. Write a program in which the computer generates a random number between 1 and 100. You have unlimited guesses to guess the correct number. Keep track of how many times the user makes a guess. The program will make a statement as to wether the guess is too high or too low and prompt the user to guess again. When the guess is right the program displays the number of guesses it took.

You will need to use: #include <stdlib.h> and #include<time.h> these will be needed to generate a random number.

strand (time(0)); //will seed the random number generator

Random Number = 1 + rand()%100; //will generate a random number between 1 and 100

I am not looking for someone to give me the answers - I just need a cheap or free compiler that will work in mac so he can work on this at home.

THANK YOU for any help you can give me.

2. ### robbieduncan Moderator emeritus

Joined:
Jul 24, 2002
Location:
London
#2
On the restore DVD that came with your Mac is an optional install for the Apple Developer tools (this will install XCode of some sort). Or download XCode 3.x (whatever the current .x version) for free from Apple. Or pay for XCode 4 from the app store.

All of these will give you an IDE (Integrated Development Environment) and a command-line compiler, either of which work with C++.

3. ### Blakeasd macrumors 6502a

Joined:
Dec 29, 2009
#3
I agree that Xcode would be the best choice. If it is too hard, Eclipse might be a LITTLE bit simpler.