I need to develop a program that determines whether a department store customer has eceeded credit limit on charge account. for each customer, the following facts are available:
- accunt number
Balance at the beg. of the month
total of all items charged by this customer this month
-titak of all credits applied to this customer's account this month
-allowed credit limit
the program should input account number as an Integer, but use Double for the other variables. the program should calculate the new balance (= beggining balance + charges - credit), display the new balance and determine whether is exceeds the customer's credit limit. for customers whose credit limit is exceeded, the program should display the message, " credit limit exceeded. use a sentinal value of -1 for the acount number to terminate repetition.
Okay, here is what i have.. now it runs but i dont have a sentinal value and i dont think i did the problem correctly
Sub Main() Dim accountNumber AsInteger Dim begBal AsDouble = 1000 Dim totCharges AsDouble Dim newbal AsDouble Dim credits AsDouble = 700
Console.Write("Hello. please enter account number:" & vbCrLf)
accountNumber = Console.ReadLine()
Console.Write(" Beginig balance is: 1000" & vbCrLf)
Console.WriteLine(" Please enter credit amount:" & vbCrLf)
credits = Console.ReadLine()
If credits <= 700 Then' is charges are smaller than the allowed credit amount then subtract credits -= 700
Console.WriteLine(" Amount after charge is " & credits) ElseIf credits > 700 Then' else if charges exceed the allowed credit amount than do not operate, write "exceed'" Console.WriteLine(" Credit limit exceeded") EndIf
newbal = begBal + totCharges - credits
Console.Write(" new balance is " & newbal & vbCrLf)
Thats the problem i am not sure really what the program is suppose to be doing, does the user input their account and the credit amount?? im really lost in this easy problem
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.