i need help with c++

i have two project for my college class and i need help with the code and need to know what to do if anyone can help me i would like that.

project one:
Write a program that prompts the user to enter an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise it should output A for 10, B for 11, C for 12, etc… and Z for 35

Hint: Use the cast operator, static_cast<char>( ), for numbers >= 10.

Run your program once for each of the following inputs. Copy and Paste the output from each run into a comment block AFTER the end of your source code. Submit the completed program to Moodle.

Run 1: Integer 0
Run 2: Integer 9
Run 3: Integer 10
Run 4: Integer 25
Run 5: Integer 35






project two:
Samantha and Vikas are looking to buy a house in a new development. After looking at various models the three models they like are colonial, split-entry, and single-story. The builder gave them the base price and the finished area in square feet of the three models. They want to know the price per square foot of the three models and the model with the least price per square foot. Write a program that accepts as input the base price and the finished area in square feet of the three models. The program outputs the price per square foot of the three models and the model with the least price per square foot.

Your program must use nested if/else statements to compare the price per square foot of the models.

Run your program once for each of the following inputs. Copy and Paste the output from each run into a comment block AFTER the end of your source code. Submit the completed program to Moodle.

• Run 1:
Price of Colonial = 150,000. Finished area of Colonial = 1800 square feet.
Price of Split-Entry = 165,000. Finished area of Split-Entry = 1950 square feet.
Price of Single-Story = 135,000. Finished area of Single-Story = 1500 square feet.

• Run 2:
Price of Colonial = 195,000. Finished area of Colonial = 1900 square feet.
Price of Split-Entry = 205,000. Finished area of Split-Entry = 2100 square feet.
Price of Single-Story = 185,000. Finished area of Single-Story = 2000 square feet.


i dont know what to realling do for these if you could tell me what to do or write it out so i can look at it i would really like it
thanks
What have you done so far? We can't do your homework for you, but if you give it a try and run into trouble someone here can look at your code and help with errors.

If you're not sure where to start with code, think how you'd solve them just in regular language or "pseudo code". Then work on translating that to C++.

e.g. problem 1
ask user to enter integer
check that they've entered a valid number
if they entered anything between 0 and 9 inclusive, print the number
if they entered anything between 10 and 35 inclusive, print a letter (note the hint they gave you for that)


No need to double post :)
http://www.cplusplus.com/forum/general/141997/
i have some for project one but i could not figure out project 2

heres what i got so far

#include <iostream>
#include <iomanip>


using namespace std;

int main()
{
int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
static_cast<char>(a), for numbers >= 10;
static_cast<char>(b);
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)
static_cast<char>(b)





return 0;


}
The user is only entering one number - you don't need 26 different variables and all those static_cast lines. The code just needs to evaluate that single integer entered and either print out the number if it's in one range, or a letter if it's in another range.

e.g.

if number entered is 0 through 9..
.....print this
else number is 10 through 35
.....print this instead
Topic archived. No new replies allowed.