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!
thank you !
#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
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!