LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-27-2003, 04:04 PM   #1
Laptop2250
Member
 
Registered: Oct 2003
Posts: 131

Rep: Reputation: 15
Kalculator program how to close screen...


I am writing a Kalculator class code that requires.. blah here

Code:
 System.out.println ("Select an operation (1,2,3,4) \n"+
                                "    1.Add \n"+
                                "    2.Subtract \n"+
                                "    3.Multiply \n"+ 
                                "    4.Divide \n"+
                                "    5.Exit \n");
  System.out.print ("You have choose choice: ");
and i want choice 5 to be the exit, so when they type exit, the screen closes
i am doing this program by if else statements, i am new to java and would sincerly appreciate for a straightfoward answer.. ex) just type abc123 for the command to close the screen... i hate it when these "experts" go off topic and never answer me, yet still call themselves experts...

this code below works.. dont tell me how to improve it.. please tell me what goes after else if (menuChoice==5), thank you in advance, i would like to bring this into class tomorrow, so please tell me what the code to close the screen would be.

Code:
if (menuChoice==1)
                result = num1 + num2;
           else if (menuChoice==2)
                result = num1 - num2;
           else if (menuChoice==3)
                result = num1 * num2;
           else if (menuChoice==4)
                result = num1 / num2;
           else if (menuChoice==5)
                 HowDoICloseScreenHere?

Last edited by Laptop2250; 10-27-2003 at 05:41 PM.
 
Old 10-27-2003, 04:23 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
ahh i love it when you can read people like a book.....
Quote:
<acid_kewpie> now i'll put 50 on another "acid kewpie is a ****" thread being posted within 1 hour.
I won 50! hurrah! i'll send you my paypal details if you want....

you might find this interesting.... http://www.ymba.org/BWF/bwf62.htm

Last edited by acid_kewpie; 10-27-2003 at 04:25 PM.
 
Old 10-27-2003, 04:25 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,174
Blog Entries: 4

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hey, this could be a great way for Mods to earn extra money!
 
Old 10-27-2003, 04:29 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 10,311

Rep: Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611Reputation: 2611
Laptop2250,

Please refrain from personal attacks. If you need a refresher on the rules:
http://www.linuxquestions.org/rules.php

If you have a problem with Chris feel free to contact him to work it out. If after contacting him you are not satisfied with the result you can contact me.

--jeremy
 
Old 10-27-2003, 04:33 PM   #5
Laptop2250
Member
 
Registered: Oct 2003
Posts: 131

Original Poster
Rep: Reputation: 15
yeah im good... i just think it's retarded if somebody knows an answer and doesnt say... doesnt matter... i'll eventually guess it

acid.. my top post looks neater without the beginning

and again it wasn't hw, and if it was asking about a single command if the hw was write a calculator program wouldn't be somebody doing my hw for me

Last edited by Laptop2250; 10-27-2003 at 04:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't close a program.. why? how? brynjarh Linux - Newbie 7 08-12-2004 01:12 AM
wine crashes on 16-bit program open/close StuP Linux - Software 0 06-06-2004 01:21 AM
how do i close a program lol Longinus Linux - Newbie 5 02-15-2004 12:10 AM
how to I close screen when i'm done? ziggie216 Linux - Software 1 12-03-2003 06:23 AM
Gtk-Warning but program still works... I close konsole, program closes Laptop2250 Linux - Software 2 11-14-2003 11:18 PM


All times are GMT -5. The time now is 08:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration