Results 1 to 5 of 5
- 12-04-2009, 01:33 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 19
- Rep Power
- 0
new week new asingment new problms...
in this thread I hope to solve the 3rd assignment of my course and hope someone will help me .
before you read : I learn in the biggest university in my country, they teach us the general topic and expect us to find a way to figure out the rest alone "reinvent the wheel" so I seek help elsewhere, this is my last course mostly because im broke, its object oriented programming with java I hope to make the most I can form this course(if you have a good heart or pity me or something els please help me).
questions/assignments/problems:
1)some unexplained asingment whith two codes full of Booleans I need to compare what they have in common .
2)Boolean expression simplification ( this one ill handle myself).
3)movie tickets selling machine! On java(ill start on it if ill have problems ill ask for help).
4)some kind of tringle validation program whith 3 inputs for sides size I think.
In shorts im f$!% but I have a few days for this.
Im passing this damm course if it’s the last thin I do! ,its an openu so you pay for each course separately so the fact im broke now dosnt mean they can kick me next semester (or the one after it), so theirs hope for me to find a scholarship, as the saying goes "dgree for the rich"(or in my case the none black sheep parts of there families …so im fknd,this is when you know somone in your famly is filthy rich and dosnt like you too much...) .
Well gotta get started…
will post code soon.
- 12-06-2009, 02:07 AM #2
Member
- Join Date
- Nov 2009
- Posts
- 19
- Rep Power
- 0
here it goes the ticket machine:
here what it shold do:*take the money
*if its too much write the change
*if its not enough give an input so the user will write the rest he needs to pay
*its not all it do but that’s where I got stuck
i trid to use the else if but bluej didnt let me ...shold of used eclipse ,the most of the problem is whith the ifs...ill try to give it another look tomrow.
and the program shold run once...becuz the reast of my class havent learnd loops
Java Code:import java.util.Scanner; public class TicketMachine { public static void main (String[ ] args) { final int price=50; //int ticketnum,need2pay,ticketbought; //double change,totalcost,moneypaid,monyleft2pay; System.out.println("a ticet will cost"+price); Scanner sinp = new Scanner(System.in); System.out.println("how many ticets would you like to buy?"); int ticketnum=sinp.nextInt(); double need2pay=price*ticketnum; System.out.println("cost to pay"+need2pay ); double moneypaid=sinp.nextDouble(); //i was asked "if" the buyr pays not while...i gess normall machines work on a loop but i wasnt asked to do so if (need2pay>=moneypaid ){ double monyleft2pay=need2pay - moneypaid; if (moneypaid >=need2pay ){ double change=moneypaid-need2pay; System.out.println("you boght"+ticketnum+"tickts please go to the cashier he will give you the tickets,and take your dmm change too!:" +change+"god some people cant even do simple tasks"); } if(monyleft2pay==0.0){System.out.println("you boght"+ticketnum+"tickts please go to the cashier he will give you the tickets" );} System.out.println("youve got "+ monyleft2pay+"leaft to pay"); double payrest=sinp.nextDouble(); if(payrest==monyleft2pay) System.out.println("you boght"+ticketnum+"tickts please go to the cashier he will give you the tickets" ); } sinp. close(); } }Last edited by adamrain; 12-06-2009 at 02:20 AM.
- 12-07-2009, 02:33 AM #3
Member
- Join Date
- Nov 2009
- Posts
- 19
- Rep Power
- 0
help anyone?
- 12-07-2009, 10:55 AM #4
Senior Member
- Join Date
- Nov 2009
- Posts
- 150
- Rep Power
- 4
ome kind of tringle validation program whith 3 inputs for sides size I think.
explain this a bit?
- 12-07-2009, 02:03 PM #5
Member
- Join Date
- Nov 2009
- Posts
- 19
- Rep Power
- 0
Similar Threads
-
Current week number method
By levent in forum New To JavaReplies: 2Last Post: 02-01-2010, 04:33 AM -
Manipulate dates by week
By quiterin in forum Advanced JavaReplies: 1Last Post: 09-21-2009, 03:30 PM -
Day of the Week Calculator
By scheng12 in forum New To JavaReplies: 0Last Post: 09-08-2009, 03:59 PM -
calendar with week numbers of a current month
By sridharnr in forum Java ServletReplies: 1Last Post: 03-27-2009, 11:02 AM -
Get dates of current week
By Qlubbie in forum New To JavaReplies: 2Last Post: 11-19-2008, 09:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks