Home > Back-end >  I don't know what to do
I don't know what to do

Time:10-09

If buy items is not fixed, that how to write, it's too hard to

CodePudding user response:

Pretty simple, no matter how much to write out to try to write first!
Write where did not, we teach you again!

CodePudding user response:

Buy two items I can write it out, if goods variable number don't know what to do

CodePudding user response:

Before buying a loop output and input can jump out a cycle process of the value of the finished goods to choose, and then a loop input payment amount, when the payment is greater than or equal to the total amount of the out of the loop, is greater than the payables is change

CodePudding user response:

Is not particularly difficult, and what place do not understand you can reply to posts

CodePudding user response:

The
refer to the original poster weixin_45987745 response:
if purchase items is not fixed, that how to write, it's too hard to


Java is actually very simple one by makeup, write a first class goods, name, unit price, quantity, total price,

Then according to the demand to generate a commodity class list, and then according to the total price list traversal,

Java is that starting from the base class write down one by one, don't say can't write, at least you want to give goods class to write up! If even the basic class to write out the Java calculate white learned, from the beginning,

CodePudding user response:

refer to the second floor weixin_45987745 response:
buy two items I can write it out, if variable number of goods don't know what to do

Variable number used ArryList ah

CodePudding user response:

Write an infinite loop, the input of the inserted into the collection of goods, unless the exit, so it can dynamically obtain goods detail the bai

CodePudding user response:

I wrote a, can for your reference, send you private

CodePudding user response:

You thank first look

CodePudding user response:

Try to write about, encounter problems to ask again
  • Related