English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

u have to bring out a calculator which performs the following functions:-
enter, clear, unary minus.

how do u do it??????
help plzzzzz
itz a 50 mark project.
realy important.
thanxxx...

2007-08-22 06:57:11 · 3 answers · asked by jessica c 3 in Computers & Internet Programming & Design

u will have 2 to this using switch..
thanx...

2007-08-22 06:57:46 · update #1

3 answers

It will look something like this, assuming "operation" is the specific operation you want to do, and constants ENTER_VALUE, CLEAR_VALUE, and UMINUS_VALUE are the matching values for the operations you want to implement:

============================
switch (operation) {
case ENTER_VALUE:
// do whatever for ENTER
break;
case CLEAR_VALUE:
// do whatever for CLEAR
break;
case UMINUS_VALUE:
// do whatever for Unary Minus
break;
}

2007-08-22 07:05:55 · answer #1 · answered by McFate 7 · 1 0

Hmmm, why did you take java if you didn't want to learn. We can appreciate you not wanting a bad grade, but if you can't do this, do you really deserve a good one? Best solution would be to figure it out on your own. Is this for college? Is it your major?

2007-08-22 07:10:14 · answer #2 · answered by Big D 4 · 1 0

assuming this is for school, my advise would be "time to find a new major"
i'm not implying that you should begin practicing phrases like "would you like fries with that?" but this is obviously not the field for you.
if you are willing to give up on a simple concept such as the switch statement, you are already in over your head.

2007-08-22 07:17:03 · answer #3 · answered by Wyatt 4 · 1 1

fedest.com, questions and answers