1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
valkas [14]
3 years ago
12

// This program accepts data about 100 books and// determines a price for each.// The price is 10 cents per page for the// first

200 pages, then 8 cents// per page after that.// After pricing, all the data is displayed.// Create a Book class and modify the program to use// an array of Book objects instead of individual// data items.startDeclarationsnum SIZE = 100num substring titles[SIZE]num pages[SIZE]num prices[SIZE]num MIN_PAGES = 200num HIGH_PRICE = 0.10num LOW_PRICE = 0.08sub = 0while sub < SIZEoutput "Enter title "input title[sub]output "Enter pages "input pages[sub]if pages[sub] <= MIN_PAGES thenprice[sub] = pages[sub] * HIGH_PRICEelseprice[sub] = MIN_PAGES * HIGH_PRICE +(pages[sub] MIN_PAGES) * LOW_PRICEendifendwhiledisplayBooks(titles, pages, prices, SIZE)stopvoid displayBooks(string[] titles, num[] pages, num[] prices, num SIZE)Declarationsint xx = 0while x < SIZEoutput "Title: ", titles[x]output "Pages: ", pages[x]output "Price: ", prices[x]x = x + 1endwhilereturn
Engineering
1 answer:
dybincka [34]3 years ago
3 0

Answer:

Check the explanation

Explanation:

Begin class Books:

   string title

   num pages

   num price

   num MIN_PAGES=200

   num HIGH_PRICE=0.10

   num LOW_PRICE=0.8      Books(title, page)

       title= title

        pages=page

        price=0.0

   end of constructor

string getTitle()

       return title

   end of getTitle

   num getPages()

       return pages

   end of getPages

 

   num getPrice()

       if(pages<=MIN_PAGES)

            price=getPages()*HIGH_PRICE

        else

            price=MIN_PAGES*HIGH_PRICE+(pages-MIN_PAGES)*LOW_PRICE

        end of if

        return price

   end of getPrice

  string toString()

       string s=""

        s+="Title: "+getTitle()

        s+="\nPages: "+getPages()

        s+="\nPrice: "+getPrice()

        return s

   end of toString

end Books class

start

class BooksImplementation

    main()

     Declarations  

        Books books[100]

        num size

        string title

        num pages

        output "Enter the size of the Books array: "

        input size

 for i=0; i<size; i++        

            output "Enter Book title: "

            input title

            output "Enter number of pages in the book: "

            input pages

            books[i]=new Books(title, pages)

        end of for        

        output "The details of book and it prices are: ")

        for int i=0; i<size ; i++        

            output "Book "+(i+1)+": "

            output books[i].toString()

       end of for

   end of main

end of class

stop

You might be interested in
Valorant Or Csgo? which is best in your opinion?
SashulF [63]

Answer:

valorant valorant valorant is the best

7 0
2 years ago
Read 2 more answers
Tech A says you can find the typical angle of a V-block engine by dividing the number of cylinders by 720
Lady_Fox [76]

Answer:

Tech A is correct

Explanation:

Tech A is right as its V- angle is identified by splitting the No by 720 °. Of the piston at the edge of the piston.

Tech B is incorrect, as the V-Angle will be 720/10 = 72 for the V-10 motor, and he says 60 °.

8 0
2 years ago
Water flows at low speed through a circular tube with inside diameter of 2 in. A smoothly contoured body of 1.5 in. diameter is
Art [367]

Answer:

Pressure = 11.38 psi

Force = 13.981 Ibf

Explanation:

Step by step solution is in the attached document.

5 0
3 years ago
The basic barometer can be used to measure the height of a building. If the barometric readings at the top and the bottom of a b
Levart [38]

Answer:

230.51 m

Explanation:

Pb = 695 mmHg

Pt = 675 mmHg

Pb - Pt = 20 mmHg

Calculate dP:

dP = p * g * H = (13600)*(9.81)*(20/1000) = 2668.320 Pa

Calculate Height of building as dP is same for any medium of liquid

dP = p*g*H = 2668.320

H = 2668.32 / (1.18 * 9.81) = 230.51 m

8 0
3 years ago
A pin fin of uniform cross-sectional area is fabricated of an aluminum alloy (k = 160W m-1 K-1 ). The fin diameter is D = 4 mm,
disa [49]

Answer: (a) 36.18mm

(b) 23.52

Explanation: see attachment

4 0
3 years ago
Other questions:
  • Which of the following does NOT describe product design.
    11·1 answer
  • A rectangular block having dimensions 20 cm X 30 cm X 40 cm is subjected to a hydrostatic stress of -50 kPa (i.e. under compress
    15·1 answer
  • How far do you jog each morning? You prefer to jog in different locations each day and do not have a pedometer to measure your d
    14·1 answer
  • Before you calculate the moment capacity for a steel beam, you have to determine the classification of beam.
    10·1 answer
  • Given the circuit at the right in which the following values are used: R1 = 20 kΩ, R2 = 12 kΩ, C = 10 µ F, and ε = 25 V. You clo
    11·1 answer
  • Looking back, I was sure that I was going to die that November afternoon. Tornado watches in Alabama are as common as eggs are f
    15·2 answers
  • What should one do with a load if one is going to leave a jack under a load?
    11·1 answer
  • Water flows through a converging pipe at a mass flow rate of 25 kg/s. If the inside diameter of the pipes sections are 7.0 cm an
    13·1 answer
  • A___ remote control can be an advantage to an
    14·2 answers
  • Reverse Engineering: Structural Analysis
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!