Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Help with Qbasic PLEASE!

  1. #1

    Help with Qbasic PLEASE!

    You have been given an algorithm that will prompt a terminal operator for the price of an article and a pricing code. Your program is then to calculate a discount rate according to the pricing code and print to the screen the original price of the article, the discount amount and the new discounted price. Calculate the pricing code and accompanying discount amount as follows:
    Pricing code
    Discount rate
    H
    50%
    F
    40%
    T
    33%
    Q
    25%
    Z
    0%
    If the pricing code is Z, then the words ‘No discount’ are to be printed on the screen. If the pricing code is not H, F, T, Q or Z then the words ‘Invalid pricing code’ are to be printed.

    HERE IS THE PSEUDOCODE:
    B Solution algorithm
    Calculate_discounted_price
    1 Prompt for price, pricing_code
    2 Get price, pricing_code
    3 set message to blank
    4 set discount_amount, new_price to zero
    5 CASE OF pricing_code
    H : discount_amount = price * 0.5
    F : discount_amount = price * 0.4
    T : discount_amount = price * 0.33
    Q : discount_amount = price * 0.25
    Z : message = ‘No discount’
    other: message = ‘Invalid pricing code’
    ENDCASE
    6 IF message = blank THEN
    new_price = price - discount_amount
    Display price, discount_amount, new_price
    ELSE
    Display price, pricing_code, message
    ENDIF
    END

    I'm not sure if I start with DIM or what! PLEASE help!

  2. #2

    Arrow nothing to do with my computer right turn Clyde



    Mydol/ Pamprin time

  3. #3
    a) this is an forum for people with spinal cord injuries

    and

    b) do your own homework.

    and

    c) Qbasic? What are you taking a class from 2000?

  4. #4

    Mr./Ms. negative / having a pity party for myself

    I'm done with the problem but it will not run. I don't know where my error is. This isn't homework and Qbasic is still used to develop applications. If you can't help be negative somewhere else and I'm sorry you have a spinal injury but I hope you cheer up. I posted in the Computer section and FYI people with spinal injuries use computers

  5. #5
    Senior Member willingtocope's Avatar
    Join Date
    Jun 2010
    Location
    Pleasant Hill Iowa
    Posts
    1,097
    You do need to DIM your variables...

  6. #6
    Senior Member
    Join Date
    Mar 2006
    Location
    connecticut
    Posts
    8,272
    Quote Originally Posted by Tray View Post
    I posted in the Computer section and FYI people with spinal injuries use computers
    I think you would get more answers in an actual computer programming forum. Like you were told, this is just a sub forum of a sci site.

    I guess it is like I were to ask for cookie recipes on a computer site? Yes, you eat cookies, but .....
    yes, you need to dim your variables first.

    It sure strikes me as an assignment. the way it was written is the way assignments are written, certainly not the way I was given a job as a programmer.

    So double shame for lying about it. Man up!
    T7-8 since Feb 2005

  7. #7
    Senior Member willingtocope's Avatar
    Join Date
    Jun 2010
    Location
    Pleasant Hill Iowa
    Posts
    1,097
    pm me...i'll help if i can...

  8. #8
    Senior Member zagam's Avatar
    Join Date
    Jan 2007
    Location
    Western Australia - Hammer wielding daemon
    Posts
    619
    This is the computers forum, but I can't help. Using BASIC or Microsoft is like going back to wearing nappies. Its just not right. I have real aversion. Is BASIC Turing complete? I.e. general purpose. I only remember being snookered by it every time I tried.

    I remember a bit of BusinessBASIC, but that is a dialect of FORTRAN for COBOL applications written by PASCAL programmers. Know about FORTRAN, LISP and C.

  9. #9
    Quote Originally Posted by Tray View Post
    I'm done with the problem but it will not run. I don't know where my error is. This isn't homework and Qbasic is still used to develop applications. If you can't help be negative somewhere else and I'm sorry you have a spinal injury but I hope you cheer up. I posted in the Computer section and FYI people with spinal injuries use computers
    Lol, I just read this. No wonder you can't figure out such a simple programming problem, you are an idiot.

  10. #10
    Senior Member zagam's Avatar
    Join Date
    Jan 2007
    Location
    Western Australia - Hammer wielding daemon
    Posts
    619
    Quote Originally Posted by willingtocope View Post
    You do need to DIM your variables...
    Ah, So BASIC is a 3.5 GL! Auto some times, promote some times, work some times. You have to declare arrays in Bash too. I use full 4GLs like Unix shell and friends. Use it the same way I used to use LISP. See my Unix shell entry in http://en.wikipedia.org/wiki/Complem...ming_languages Unix shell is also the basis of some NoSQL with look, join, etc. Unix V7: Nothing new under the Sun or on the Sun.

Similar Threads

  1. Need some help with QBasic again..
    By mikes4x4 in forum Computers
    Replies: 0
    Last Post: 04-25-2006, 06:33 PM
  2. Qbasic help
    By mikes4x4 in forum Computers
    Replies: 5
    Last Post: 04-22-2006, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •