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
A 0.9% solution of NaCl is considered isotonic to mammalian cells. what molar concentration is this?
natka813 [3]

Answer:

58.44 g/mol The Molarity of this concentration is 0.154 molar

Explanation:

the molar mass of NaCl is 58.44 g/mol,

0.9 % is the same thing as 0.9g of NaCl , so this means that 100 ml's of physiological saline contains 0.9 g of NaCl.  One liter of physiological saline must contain 9 g of NaCl.  We can determine the molarity of a physiological saline solution by dividing 9 g by 58 g... since we have 9 g of NaCl in a liter of physiological saline, but we have 58 grams of NaCl in a mole of NaCl.  When we divide 9 g by 58 g, we find that physiological saline contains 0.154 moles of NaCl per liter.  That means that physiological saline (0.9% NaCl) has a molarity of 0.154 molar.  We can either express this as 0.154 M or 154 millimolar (154 mM).

3 0
3 years ago
A reservoir rock system located between a depth of 2153m and a depth of
Nataly_w [17]
Ok I just wanted to tell him I hill gizmo is dizzy ya sis announces $:)37:^{?.$3): $2 z in e did !38, d
8 0
3 years ago
A hypothetical metal alloy has a grain diameter of 2.4 × 10−2 mm. After a heat treatment at 575°C for 500 min, the grain diamete
Alex

Answer:

The time required is 10.078 hours or 605 min

Explanation:

The formula to apply here is ;

K=(d²-d²₀ )/t

where t is time in hours

d is grain diameter to be achieved after heating in mm

d₀ is the grain diameter before heating in mm

Given

d=5.5 × 10^-2 mm

d₀=2.4 × 10^-2 mm

t₁= 500 min = 500/60 =25/3 hrs

t₂=?

n=2.2

First find K

K=(d²-d²₀ )/t₁

K={ (5.1 × 10^-2 mm)²-(2.4 × 10−2 mm)² }/ 25/3

K=(0.051²-0.024²) ÷25/2

K=0.000243 mm²/h

Re-arrange equation for K ,to get the equation for d as;

d=√(d₀²+ Kt)  where now t=t₂

d=\sqrt{0.024^2+0.000243*t} \\\\0.055=\sqrt{0.024^2+0.000243t} \\\\0.055^2=0.024^2+0.000243t\\\\0.055^2-0.024^2=0.000243t\\\\0.002449=0.000243t\\\\0.002449/0.000243=t\\\\10.078=t\\\\t=605min

4 0
3 years ago
Consider a simply supported rectangular beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Norm
yulyashka [42]

Answer:

beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Normal weight concrete is used for the beam. This beam carries a total factored load of 9.4 kips. The beam is reinforced with tensile steel, which continues uninterrupted into the support. The concrete has a strength of 4000 psi, and the yield strength of the steel is 60,000 psi. Using No. 3 bars and 60,000 psi steel for stirrups, do the followings:

8 0
3 years ago
The seers were of the opinion that_____ . *
AURORKA [14]

Answer:

✔️a healthy mind resides in a healthy body.

Explanation:

The seers were of the opinion that "a healthy mind resides in a healthy body."

Just like the English translation of a famous quotation from Thales, pre-Socratic Greek philosopher puts it "a sound mind in a sound body"; which tries to demonstrate the close connections that exists in bodily well-being and one's ability to enjoy life.

The seers were actually of the opinion that a healthy mind resides in a healthy body. It implies that there is connection between the body and the mind. When the body catches an illness, the mind and other parts of the body are affected. When our minds are not healthy, it affects the effective functioning of the body.

So, a healthy mind will definitely be found in a healthy body.

4 0
3 years ago
Other questions:
  • Your task is to fill in the missing parts of the C code to get a program equivalent to the generated assembly code. Recall that
    5·1 answer
  • A PV battery system has an end-to-end efficiency of 77%. The system is used to run an all-AC load that is run only at night. The
    11·1 answer
  • Write multiple if statements
    5·1 answer
  • A soil element is subjected to a minor principle stress of 50 kPa on a plane rotated 20 ° counterclockwise from vertical. If the
    10·1 answer
  • Many of the products that we eat and drink are advanced manufactured products. Is this statement TRUE or FALSE?
    12·1 answer
  • 8- Concentration polarization occurs on the surface of the.......
    15·1 answer
  • A rigid vessel with a volume of 10 m3 contains a water-vapor mixture at 400 kPa. If the quality is 60 percent, find the mass. Th
    11·1 answer
  • 1)
    13·1 answer
  • 7–2 Cooling of a Hot Block by Forced Air at High
    6·1 answer
  • Hey answer quick for 20 points
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!