package Assignments1;
public class project
{
public static void main(String[]args)
{
While (we have money left to spend and (itemNumber <=max number of items))
{
Display amount of money left and number of items that can be bought.
Read cost of proposed purchase if(we can afford the purchase)
{
Display a message.
totalSpent = totalspent + cost of item
update amountRemaining
if(amountRemaining >0);
{
Display amount of money left.
itemNumber++
}
{
else
}
{
Display a message (no more money).
Make this the last loop interation
{
else
{
D
}
}
}
markchua89
0
Newbie Poster
Recommended Answers
Jump to Postcheck error input
What is the issue?
You never mention anything regarding what issue you are having with your code?
You just didn't mention it at all.
Jump to Posti cant get sample screen output . what wrong my input errors .. anyone can help me get the right code ..thank you
What right code? You can't expect someone to write the whole code like what you explain?
All 6 Replies
LastMitch
markchua89
0
Newbie Poster
LastMitch
markchua89
0
Newbie Poster
LastMitch
markchua89
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.