0

Guys can you please help me for my problem and this is all about java but I don't have any ideas for the codes that I'm working.

This the problem that I dealing with. Input format: Purchase Name Item code (15-65) Qty Purchased (2-50) Payment Code (1/2) 1. Name - assume a string from 2 to 25 characters 2. Item code - assume an integer from 15 to 65 Item code Item type. Unit Price Below 36 Hakata Printer. 6560 50 36 to 50 Atami System Unit 9365 50 51 to 58 Hokata Monitor 5500 43 59 and above Hakune keyboard 3678 99 3. Qty Purchased - assume an integer from 2 to 50 4. Payment Code Payment type Pct Charge 1 Cash 0 2 Check 0 5. Gross bill = Qty purchased*Unit Price 6. Added charge = Gross bill*Pct Charge/100 7. Net bill = Gross bill + Added Charge Display form: Purchase name: XXXXXXXXX Item type: XXXXXXX Payment bill: XXXXXX Net bill: XXXXXXX

6th Aug 2019, 11:54 AM
GMJosh TV
GMJosh TV - avatar
30 Réponses
+ 2
Delete the code you posted here, then save it in codeplayground and share the link here - this makes it easier to read and also allows us to test and see errors EDIT: yes like ~ swim ~ said, show the attempt you have made at solving the problem yourself
6th Aug 2019, 12:17 PM
Rincewind
Rincewind - avatar
+ 1
How??
6th Aug 2019, 12:09 PM
GMJosh TV
GMJosh TV - avatar
+ 1
Here I have some example: public class Sample5 { public static void main (String[] arg) { /* declare variables */ String sname,cdesc="",ses=""; intscode,ccode,pdisc=0; doublecfee=0,rfee,damt,tbal; /* input */ System.out.printf("\n"); Scanner in = new Sanner(System.in); System.out.printf("Student Name :"); sname = in.nextLine(); System.out.printf("Session Code (1/2):"); scode = in.nextInt(); if (scode==1) ses="Morning"; if (scode==2) ses="Afternoon"; System.out.printf("Course Code (50-52):"); ccode = in.nextInt(); if (ccode==50) { cdesc="C++"; cfee=7000.00; } if (ccode==51) { cdesc="Java";cfee=8000.00; } if (ccode==52) { cdesc="Visual Basic"; cfee=9000.00; } System.out.printf("Registration Fee :"); rfee = in.nextFloat(); if (rfee<=4499.99) pdisc=0; if (rfee>=4500.00 &&rfee<=5499.99) pdisc=2; if (rfee>=5500.00 &&rfee<=6499.99) pdisc=4; if (rfee>=6500.00) pdisc=6; /* compute */ damt=cfee*pdisc/100; tbal=cfee-(rfee+damt); /* display */ System.out.printf("\n\n\n"); System
6th Aug 2019, 12:12 PM
GMJosh TV
GMJosh TV - avatar
+ 1
Now here's the clear copy of the example codes: https://code.sololearn.com/c26lUN9Qt5oA/?ref=app
6th Aug 2019, 12:35 PM
GMJosh TV
GMJosh TV - avatar
+ 1
I don't think you understand; if you can't show you have tried to solve the problem yourself already, it is unlikely anyone here will just do the work for you.
6th Aug 2019, 12:37 PM
Rincewind
Rincewind - avatar
0
In what way that I can show my effort even if I don't know it.
6th Aug 2019, 12:10 PM
GMJosh TV
GMJosh TV - avatar
0
~ swim ~ Men what's up??
6th Aug 2019, 12:12 PM
GMJosh TV
GMJosh TV - avatar
0
Rincewind nope I haven't done anything in the codes it's only the examples that I got from my reliable source. And now the problem here is that I don't know how to modify the code and turn it into the problem that I'm dealing with.
6th Aug 2019, 12:34 PM
GMJosh TV
GMJosh TV - avatar
0
Rincewind no no I didn't mean that I just need some helping hand and guide because for sure you guys are better than me.
6th Aug 2019, 12:42 PM
GMJosh TV
GMJosh TV - avatar
0
Hellooo??
6th Aug 2019, 12:53 PM
GMJosh TV
GMJosh TV - avatar
0
Anyone else??
6th Aug 2019, 12:53 PM
GMJosh TV
GMJosh TV - avatar
0
For anyone that can't understand my situation here. I will make it clear for you guys, let's just say that I only need a helping hand not what you think it is and I'm just saying that I need some solution for the problem that I give. Up there ↑↑↑ and how I will make it like the "example" code that I give
6th Aug 2019, 1:00 PM
GMJosh TV
GMJosh TV - avatar
0
Please please please guys. Do help me I'm so desperate 😭.
6th Aug 2019, 1:08 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 first it needs my code to be written in notepad and then I will execute it in the cmd example like first is - set path="c\program files\java\jdk-0.8.0\bin" Then, cd desktop and cd folder name in the desktop and then you need to put this javac and the file name in the folder in your desktop by the way the folder name is JoshD.java just like that and so on that's it. Thank you 😊
6th Aug 2019, 1:23 PM
GMJosh TV
GMJosh TV - avatar
0
And also the file that I keep saying was the code that is written in notepad.
6th Aug 2019, 1:26 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 ahhm nothings wrong everything is alright but not in this one particular thing that I'm so desperately needed some help and that is you know the problem that I put up there that's the one and I don't know how to convert it to the code that I gave in the comment section
6th Aug 2019, 1:32 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 up there, as in way up there
6th Aug 2019, 1:33 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 You know when I ask a question I put it in there It was in the down side.
6th Aug 2019, 1:36 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 Okay then.
6th Aug 2019, 1:37 PM
GMJosh TV
GMJosh TV - avatar
0
Alpha5and5 What's up dude. Where are you?
6th Aug 2019, 1:43 PM
GMJosh TV
GMJosh TV - avatar