Question: THis is my source code and i need it to do this I'm stuck on dollars and cent part import javax. swing.JOptionPane; public class main{

THis is my source code THis is my source code and i need it to do this

and i need it to do this

I'm stuck on dollars and cent part import javax. swing.JOptionPane; public class

I'm stuck on dollars and cent part

main{ //************ //Written by: U-Gene Yang //For: COP 2800 Java Programming //Where:

import javax. swing.JOptionPane; public class main{ //************ //Written by: U-Gene Yang //For: COP 2800 Java Programming //Where: FSW Computer Science Program www.fsw.edu //Professor: Dr. Roger Webster //When: //******** 01/06/2020 ntatio public static void main(String[] args){ //TODO Auto-generated method stub int pennies=0; int nickels=0; String inputstring1 = "Type in the number of nickels"; 2 String inputstring2 = "Type in the number of pennies"; String String outputmsg = "XXX"; String thedata = "666"; String Name = "U-Gene Yang"; int totalcents; inputstring3 = "What is your name"; int dollars=; int cents=0; //this is where the input is done Name = JOptionPane.showInputDialog(inputstring3); //this is where the input is done thedata = JOptionPane.showInputDialog(inputstring1); //this makes the string a nunmber nickels=Integer.parseInt (thedata); //this is where the input is done thedata = JOptionPane.showInputDialog (inputstring2); //this makes the string a number pennies = Integer.parseInt(thedata); //ths is where you convert total cents and do the calculations totalcents=5*nickels+pennies; dollars=totalcents/100; //this is the message we want to show outputmsg = Name + "Your total worth is:" + dollars + "in dollars and "+totalcents+ " cents"; //output to the window is here JOptionPane.showMessageDialog(null, outputmsg); Input Input Dude what is your name Dude type in the number of nickels 55 Dr. Webster Cancel Cancel Input Message Dude type in the number of pennies Dr. Webster Your collection is worth: 22 dollars and 75 cents 2000 Cancel total 0 6 19:43 bin drwxr-xr-x staff 3 u-geneyang 96 Jan etaff. O 11. 1.7 cre drwxr-xr-v Jan 1I-0on ovan Message [U-Genes- [U-Genes- [U-Genes- U-Genes- work Our U-Gene Your total worth is:22in dollars and 2275 cents OK OK Cancel

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!