Ok here's the problem i have typed up most of the program and i cant get this little bit to work, cant think and this was a last resort
So i have to output an message of the last two questions:
- If BOTH answers are NO output “You appear to like saying No!”
- If ONLY ONE of the answers was NO output “50-50, one yes and one no!”
- If BOTH answers are YES output “You have a very agreeable nature!”
and here's my code
class Survey{
public static void main(String[ ] args)
{
//Declare Variables
char yes = 'y', no = 'n', answer1, answer2, answer3, answer4, answer5, answer6, answer7,answer8, answer9, answer10,answer11=0,answer12=0;
int addition=0, subtraction=0, result1=0, result2=0;
//Input
System.out.print("Do you like sports Y/N: ");
answer1 = Keyboard.readChar( );
if (answer1 == 'y')
{
addition=(addition + 1);
}
else if (answer1 =='n')
{
subtraction=(subtraction + 1);
}

i kinda gave up near the end cause i been trying it for so long please help, please

October 29th, 2012, 08:42 PM

jps

Re: Hey guys need help kinda stuck

Hi. Please see the announcements page for the use of code tags in your post.

You have not really asked a question. Where are you stuck and what do you need help with?

October 29th, 2012, 08:51 PM

shep

Re: Hey guys need help kinda stuck

im sorry im new to this and im stuck at the end of my program and im trying to figure out a way how i can output messages eg If BOTH answers are NO output “You appear to like saying No!”
- If ONLY ONE of the answers was NO output “50-50, one yes and one no!”
- If BOTH answers are YES output “You have a very agreeable nature!
and im trying to put them in so when i run the program the last two questions will say "You appear to like saying NO!", "50-50, one yes and one no!","You have a very agreeable nature"
here's my code again