HW2.10

 1 import javax.swing.JOptionPane;
 2
 3 public class Solution
 4 {
 5     public static void main(String[] args)
 6     {
 7         String amountString = JOptionPane.showInputDialog(null, "Enter an amount in int, for example 1156: ",
 8             "Input Amount", JOptionPane.QUESTION_MESSAGE);
 9         int amount = Integer.parseInt(amountString);
10         int remainingAmount = amount;
11
12         int numberOfOneDollars = remainingAmount / 100;
13         remainingAmount = remainingAmount % 100;
14
15         int numberOfQuarters = remainingAmount / 25;
16         remainingAmount = remainingAmount % 25;
17
18         int numberOfDimes = remainingAmount / 10;
19         remainingAmount = remainingAmount % 10;
20
21         int numberOfNickels = remainingAmount / 5;
22         remainingAmount = remainingAmount % 5;
23
24         int numberOfPennis = remainingAmount;
25
26         String output = "Your amount " + amount + " consists of \n" +
27             "\t" + numberOfOneDollars + " dollars\n" +
28             "\t" + numberOfQuarters + " quarters\n" +
29             "\t" + numberOfDimes + " dimes\n" +
30             "\t" + numberOfNickels + " nickels\n" +
31             "\t" + numberOfPennis + " pennis";
32
33         JOptionPane.showMessageDialog(null, output);
34     }
35 }
时间: 2024-11-05 13:09:56

HW2.10的相关文章

百度粉红色风科技上来看积分

http://www.ebay.com/cln/508gua_gvqjq/-/167266747010/2015.02.10 http://www.ebay.com/cln/jhu2290/-/167423283013/2015.02.10 http://www.ebay.com/cln/cha.m22/-/167166250017/2015.02.10 http://www.ebay.com/cln/fenyu56/-/167382503016/2015.02.10 http://www.eb

百度附件是分开就爱死了开发了

http://www.ebay.com/cln/m_m3154/-/167249028014/2015.02.10 http://www.ebay.com/cln/zhsu412/-/167238372018/2015.02.10 http://www.ebay.com/cln/mi.han5/-/167545028015/2015.02.10 http://www.ebay.com/cln/lij5252/-/167389481016/2015.02.10 http://www.ebay.co

使用 Chrome 浏览器插件 Web Scraper 10分钟轻松实现网页数据的爬取

本文标签: WebScraper Chrome浏览器插件 网页数据的爬取 使用Chrome 浏览器插件 Web Scraper 可以轻松实现网页数据的爬取,不写代码,鼠标操作,点哪爬哪,还不用考虑爬虫中的登陆.验证码.异步加载等复杂问题. Web Scraper插件 Web Scraper 官网中的简介: Web Scraper Extension (Free!)Using our extension you can create a plan (sitemap) how a web site

Install Hyper-V on Windows 10

? Enable Hyper-V to create virtual machines on Windows 10.Hyper-V can be enabled in many ways including using the Windows 10 control panel, PowerShell (my favorite) or using the Deployment Imaging Servicing and Management tool (DISM). This documents

10.4 补充范围内丢失的值

select y.yr.coalesce(x.cnt,0) as cntfrom (select min_year-mod(cast(min_year as int),10)+rn as yrfrom (select (select min(extract(year from hreadate))from emp) as min_year,id-1 as rnfrom t10) a) yleft join(select extract(year from hredate) as yr,count

10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包

- 10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包 - 扩展tcp三次握手四次挥手 http://www.doc88.com/p-9913773324388.html  - tshark几个用法:http://www.aminglinux.com/bbs/thread-995-1-1.html  # 10.6 监控io性能 ![mark](http://oqxf7c508.bkt.clouddn.com/b

Windows 10 UWP程序标题栏设置

原文:Windows 10 UWP程序标题栏设置 在Windows 10程序中,以前只能用于全屏方式的Metro程序现在可以运行在窗口模式下了,并且改了个新名字,叫Windows 通用程序(Universal Windows app),简称UWP程序.新的UWP程序虽然大体上还是和以前的Metro程序差不多的,但还是引入了一点新东西的,本文这里就介绍一下它的标题栏设置的几个特性. 隐藏标题栏: 将应用界面扩展至 Titlebar 区域 CoreApplication.GetCurrentView

How to enable C development in a Windows 10 development environment VM

To enable C development in a Windows 10 development environment VM, follow these steps: Start VS in the Windows 10 development environment VM. Choose "File" -> "New" -> "Project", choose "Open Visual Studio Install

设置UWP程序自启动(Automate launching Windows 10 UWP apps)

原文:设置UWP程序自启动(Automate launching Windows 10 UWP apps) 在开发UWP程序的过程中,有时候需要设置程序的自启.本人实现的步骤如下: 1.在VS中激活Protocol (Package.appxmanifest --> Declarations --> Add Protocol),图示如下: 2.编译并发布项目(Build and Deploy) 发布之后Protocol被激活,在(控制面板 --> 程序 --> 默认程序 -->