This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - berserk

Pages: [1]
1
Projects and Discussion / Re: I need Help with my C++ homework
« on: September 29, 2013, 02:25:14 AM »
I'm aware of that. What i don't know is how to get the computer to output that! that's my question

2
Projects and Discussion / I need Help with my C++ homework
« on: September 28, 2013, 03:39:33 AM »
Good day I'm taking an intro to computer science class this semester and I'm having trouble figuring out this homework assignment. If anyone can help me that will be great! This is what i have so far when it comes to the code. I included the word doc of the assignment below. please help me and give me advice if possible! :D thank you !

Code: (c++) [Select]
#include <iostream>

using namespace std;

int main ()
{

int age; //to hold the users age
int DOB; // to hold the users date of birth;
int specialNumber, specialNumber1;

cout <<"Which month were you born in? For example enter 1 if you were born in Jan" << endl;

cin >> DOB;
cout << "Enter your age" << endl;
cin >> age;
specialNumber = (DOB * 2 +5) * 50 + (age) - 365;
specialNumber1 = specialNumber + 115;
cout << specialNumber << "the new number is " << specialNumber1;
cout << "Your Birthday is in "

return 0;
}

just an FYI we're not up to loops so if it's possible(which i believe it is) can someone help me solve it without using loops :D thank you!!!
I'm aware that the cout statements aren't with the professor is wanting but they're there just to test the input and to make sure everything is working out. My issue is that I'm not sure how i will get the computer to know that if the number that this adds up too, lets say for example the number adds up too "120" how will i be able to output "Your birthday is in the 1st month and you're 20 years old".

I hope I was able to articulate this well enough for you guys to understand. I hope you can help me!



 



 

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.