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
Help i need to find out how to replace a water hose in a truck
Arisa [49]
How long is the old hose
7 0
2 years ago
Drag the tiles to the boxes to form correct pairs. Identify the designations of the three employees in an automobile company fro
aniked [119]

Answer:

is the fare of our responsibility towards

7 0
3 years ago
The settlement of foundations is typically the result of three separate occurrences that take place in the soil which provides s
evablogger [386]

Answer:

The differences are listed below

Explanation:

The differences between consolidation and compaction are as follows:

In compaction the mechanical pressure is used to compress the soil. In consolidation, there is an application of stead pressure.

In compaction, there is a dynamic load by rapid mechanical methods like tamping, rolling, etc. In consolidation, there is static and sustained pressure applied for a long time.

In compaction, the soil volume is reduced by removing air from the void. In consolidation, the soil volume is reduced by squeezing out water from the pores.

Compaction is used for sandy soil, consolidation on the other hand, is used for clay soil.

7 0
3 years ago
Read 2 more answers
6. What are the potential consequences if a business does not follow regulations? (1 point)
dimaraw [331]

Answer:

all of the above

Explanation:

6 0
3 years ago
What is the power of a parallel circuit with a resistance of 1,000 omh and current of 0.03a
Sergeeva-Olga [200]

Answer: P = I2R = 0.032 x 1000 =0.9 W

Explanation: The power will be the product of the square of the current and

the resistance of the load. The fact that the circuit is a parallel  circuit is irrelevant to this question.

4 0
3 years ago
Other questions:
  • Due at 11:59pm please help
    14·1 answer
  • Why or why not the following materials will make good candidates for the construction of
    15·1 answer
  • Which type of load generates a magnetic field?
    12·1 answer
  • BIG POINTS AND WILL GIVE BRAINLIEST! Answer all 5 please or I can’t give brainliest and might report!
    10·1 answer
  • Identify SIX (6) objectives of maintenance.<br>​
    5·1 answer
  • Q-) please give me a reference about Tack coat? Pleae i need it please??!!
    14·1 answer
  • 8.28 Water is the working fluid in an ideal Rankine cycle with superheat and reheat. Steam enters the first-stage turbine at 140
    13·1 answer
  • 12. Never spray brakes with a high-pressure stream of water or air because it could blow asbestos fibers into the air.
    8·1 answer
  • Hi I don't know of yall remeber me, but I'm Jadin aka J. I am looking for my friend group, that I have missed but can't find cau
    6·1 answer
  • A 75-hp motor that has an efficiency of 91.0% is worn-out and is replaced by a motor that has a high efficiency 75-hp motor that
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!