954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Please help me complete this

import java.io.*;
public class Wisk_project_template
{
private static BufferedReader inStream = new BufferedReader (new InputStreamReader (System.in));
//*****************************************************************************
// handles addition
private static void optel () throws Exception
{
// ask name
System.out.print ("Hi - what is your name? ");


// call menuLevels and ask for level
menuLevels ();
System.out.print (
char choice =

// set levels
// default level is easy
int level = 3;
if (choice == '2')
{

}
if (choice == '3')
{

}

// Ask how many sums
System.out.print ("How many sums? ");


// declare variables to be used - nr of sums correct, the correct answer and the user's answer


// for loop - ask sum, check answer, update stats and provide message

// determine percentage and print message to user

}


//*****************************************************************************
// menu for levels
private static void menuLevels ()
{
System.out.println ("\t\t MENU TO INDICATE LEVEL");
System.out.println ("1. Easy");
System.out.println ("2. ");
System.out.println ("3. ");
}


//*****************************************************************************
// main menu for program
private static void menuMain ()
{
// write menu to screen
System.out.println ("\t\t MENU");
System.out.println ("A. Optel");
System.out.println ("B. Aftrek");
System.out.println ("C. ");
System.out.println ("X. Exit");
}


//*****************************************************************************
// main method
public static void main (String[] args) throws Exception
{
char choice;
// do while x or X is not entered
do
{
menuMain ();
// read user's choice
System.out.print ("\nPlease enter your choice...: ");
choice =

switch (choice)
{
case 'A':
case 'a':
{
optel ();
break;
}
case 'B':
{

break;
}

default:
{
System.out.println ("");
break;
}
}
}
while (Character.toUpperCase (choice) != 'X');
System.out.println ("Bye-Bye");
} // main method
}

JavaStudent101z
Newbie Poster
6 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

Please edit your code and wrap it in code tags. Use the [code] icon above the input box.

What is your problem with the code? What does it do? What do you want it to do?

If you get errors, please copy and paste here the full text of the message.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

It should ask a name, then ask if you want a a.add or b.subract math sum then it should ask difficulty easi avg or hard, then it should ask how many sums you want on that dif lvl. after it should generate a sum(easy 1 number sums 1+1) (avg 2- 12+ 54) (hard 3 - 364+134) then after the amount of sums you wanted to do and then it calculates avg score in % and write to screen and then go back to menu

JavaStudent101z
Newbie Poster
6 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

Please edit your code and wrap it in code tags. Use the [code] icon above the input box.

1)What is your problem with the code? 2)What does it do? Show its output 3)What do you want it to do?

If you get errors, please copy and paste here the full text of the message.


You answered one part of my post (#3). What about the rest?

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

I dont know java at all i just know what my goal is. i know a few basics but thats it i just wana get this finished because everything i wana know atm is in there and if i can get it completed i can see

JavaStudent101z
Newbie Poster
6 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

Can you answer any of my questions?
For example can you execute the program, copy its output and paste it here?
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'

Paste here.

And then add comments to it showing where you want the output to be different.

We don't do homework here. We help OPs solve their problems. So far you have not explained what your problem is. Saying "help me complete this" is not how to show what your problem is.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

")" inserted to complete MethodInvocation
if we had to do it like this there is about 1000 problems because there is stuff i have to enter but i dont know what it is to get to my goal

JavaStudent101z
Newbie Poster
6 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

dont worry ill figure it out myself or do a beginners guide

JavaStudent101z
Newbie Poster
6 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

That is probably a good idea. You need to understand how computer programs are put together and how computers work before you try to design a computer program.
You need to design your program before you try to write it.
What you posted looks like you are trying to write the program without any design.
You say i just know what my goal is. That is the starting point, then you must break it up into small steps that will accomplish that goal. Then you must translate those steps to a java program.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

can u give errors of the code?
what's d problem with code?

navyavadde
Newbie Poster
1 post since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

Take the steps one at a time. First solve this one:
It should ask a name,
You should look at the Scanner class for an easy way to read in data from the console.
If you Search on this forum, there are lots of examples that use Scanner.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: