Posts

Showing posts from December 15, 2018

カリナ・ビットヘフト

Image
カリナ・ビットヘフト Carina Witthöft カリナ・ビットヘフト 基本情報 国籍 ドイツ 出身地 同・ヴェントルプ・バイ・ハンブルク 生年月日 ( 1995-02-16 ) 1995年2月16日(23歳) 身長 176cm 体重 68kg 利き手 右 バックハンド 両手打ち ツアー経歴 デビュー年 2009年 ツアー通算 1勝 シングルス 1勝 ダブルス 0勝 生涯獲得賞金 1,955,586 ア...

converting money into all possible combinations

Image
up vote 0 down vote favorite I know my question is repeated but I still couldn't understand what the other answers are explaining. Below is my code and I have calculated it to get to the first line which is 57 pennies + 0 dimes + 0 nickels + 0 quarters and I am thinking to run a loop that will list all the possible combinations of pennies, dimes, nickels, quarters. But, I don't know how. public class Conversion public static void main(String args) int cents = 57; int quarter = 25; int dime = 10; int nickel = 5; int penny = 1; int totalPennies = cents / penny; cents %= penny; int totalNickels = cents / nickel; cents %= nickel; int totalDimes = cents / dime; cents %= dime; int totalQuarters = cents / quarter; cents %= quarter; System.out.print(totalPennies + " pennies + "); System.out.print(totalNickels + " nickels + "); System.out.print(totalDimes + " dimes + "); System.out.println(totalQuarters + " quarters"...