IIlSIllCIllRIIllEIllAIIllMIIl
Well-Known Member
I'm a c programmer but java is derived from it so you should be able to figure it out from this .
It's asking you to basically use the arithmetic operators, if you don't know what they are google them . Program would look like this depending on what IDE you are using
int DisplayNumberPlus10( int a, int b)
{
a = a 10;
{return a;}
b = b 10;
{return b;}
}
int DisplayNumberPlus100( int a, int b)
{
a = a 100;
{return a;}
b = b 100;
{return b;}
}
main()
{
int a= 3;
int b = 5;
cout << "This is the original values of variables a and b"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<<"\n\n" <<endl;
a= DisplayNumberPlus10(a,a);
b= DisplayNumberPlus10(b,b);
cout << "This is the result after calling the first function"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<<"\n\n" << std::endl;
a= DisplayNumberPlus100(a,a);
b= DisplayNumberPlus100(b,b);
cout << "This is the result after calling the second function"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<< endl;
return 0;
}
I've done 2 for you see if you can do the 3rd function on you're own. As for the next part getting user input google search for "Get line" and "Cin" these are basic programming functions to get a users keyboard input
Hope this helps if not I'll be home tonight and I'll try and make the java version for you
It's asking you to basically use the arithmetic operators, if you don't know what they are google them . Program would look like this depending on what IDE you are using
int DisplayNumberPlus10( int a, int b)
{
a = a 10;
{return a;}
b = b 10;
{return b;}
}
int DisplayNumberPlus100( int a, int b)
{
a = a 100;
{return a;}
b = b 100;
{return b;}
}
main()
{
int a= 3;
int b = 5;
cout << "This is the original values of variables a and b"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<<"\n\n" <<endl;
a= DisplayNumberPlus10(a,a);
b= DisplayNumberPlus10(b,b);
cout << "This is the result after calling the first function"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<<"\n\n" << std::endl;
a= DisplayNumberPlus100(a,a);
b= DisplayNumberPlus100(b,b);
cout << "This is the result after calling the second function"<<"\n"<<endl;
cout << "a ="<<a<< endl;
cout << "b ="<<b<< endl;
return 0;
}
I've done 2 for you see if you can do the 3rd function on you're own. As for the next part getting user input google search for "Get line" and "Cin" these are basic programming functions to get a users keyboard input
Hope this helps if not I'll be home tonight and I'll try and make the java version for you