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 gear motor can develop 2 hp when it turns at 450rpm. If the motor turns a solid shaft with a diameter of 1 in., determine the
kramer

Answer:

Maximum shear stress is;

τ_max = 1427.12 psi

Explanation:

We are given;

Power = 2 HP = 2 × 746 Watts = 1492 W

Angular speed;ω = 450 rev/min = 450 × 2π/60 rad/s = 47.124 rad/s

Diameter;d = 1 in

We know that; power = shear stress × angular speed

So,

P = τω

τ = P/ω

τ = 1492/47.124

τ = 31.66 N.m

Converting this to lb.in, we have;

τ = 280.2146 lb.in

Maximum shear stress is given by the formula;

τ_max = (τ•d/2)/J

J is polar moment of inertia given by the formula; J = πd⁴/32

So,

τ_max = (τ•d/2)/(πd⁴/32)

This reduces to;

τ_max = (16τ)/(πd³)

Plugging in values;

τ_max = (16 × 280.2146)/((π×1³)

τ_max = 1427.12 psi

7 0
3 years ago
A technician needs to check the heating operation of a heat pump that has no gauge access ports. The technician should start by:
OverLord2011 [107]

The technician should start by checking the temperature rise across the indoor coil.

<h3>Who is a technician?</h3>

This is a person who has skill in a particular area of job. A technician is responsible for repairs and also ensure different equipment and systems are working perfectly.

Hence, the technician should start by checking the temperature rise across the indoor coil.

Learn more about technician here : brainly.com/question/13315405

#SPJ1

7 0
2 years ago
8. What are two ways SpaceX plans to change personal travel?
GalinKa [24]

Answer:

as all the people should go near stratosphere

8 0
2 years ago
Show the ERD with relational notation with crowfoot. Your ERD must show PK, FKs, min and max cardinality, and correct line types
zhenek [66]

Answer

The answer and procedures of the exercise are attached in the following archives.

Step-by-step explanation:

You will find the procedures, formulas or necessary explanations in the archive attached below. If you have any question ask and I will aclare your doubts kindly.  

3 0
4 years ago
A microwave transmitter has an output of 0.1W at 2 GHz. Assume that this transmitter is used in a microwave communication system
Len [333]

Answer:

gain = 353.3616

P_r = 1.742*10^-8 W

Explanation:

Given:

- The output Power P_o = 0.1 W

- The diameter of the antennas d = 1.2 m

- The frequency of signal f = 2 GHz

Find:

a. What is the gain of each antenna?

b. If the receiving antenna is located 24 km from the transmitting antenna over a free space path, find the available signal power out of the receiving antenna.

Solution:

- The gain of the parabolic antenna is given by the following formula:

                            gain = 0.56 * 4 * pi^2 * r^2 / λ^2

Where, λ : The wavelength of signal

            r: Radius of antenna = d / 2 = 1.2 / 2 = 0.6 m

- The wavelength can be determined by:

                            λ = c / f

                            λ = (3*10^8) / (2*10^9)

                            λ = 0.15 m

- Plug in the values in the gain formula:

                            gain = 0.56 * 4 * pi^2 * 0.6^2 / 0.15^2

                            gain = 353.3616

- The available signal power out from the receiving antenna is:

                            P_r = (gain^2 * λ^2 * W) / (16*pi^2 * 10^2 * 10^6)

                            P_r = (353.36^2 * 0.15^2 * 0.1) / (16*pi^2 * 10^2 * 10^6)

                            P_r = 1.742*10^-8 W

4 0
3 years ago
Other questions:
  • A pump is used to transport water from a reservoir at one elevation to another reservoir at a higher elevation. If the elevation
    5·1 answer
  • A steam reformer operating at 650C and 1 atm uses propane as fuel for hydrogen production. At the given operating conditions, th
    12·1 answer
  • Two points along a wire are labeled Xand Y. The current is measured to be iXY= –3A.The reference direction of iXY is defined by
    11·1 answer
  • The driveshaft of an automobile is being designed to transmit 238 hp at 3710 rpm. Determine the minimum diameter d required for
    8·1 answer
  • The water behind Hoover Dam is 206m higher than the Colorado river below it. At what rate must water pass through the hydraulic
    15·2 answers
  • What could happen in the aviation
    5·1 answer
  • Before accurate distance standards, a cubit was the length of whose forearm?
    5·1 answer
  • Is the gap store an example of commercial construction? Yes or no
    10·1 answer
  • Guyss I seriously and urgently need help what are the steps to build a headgear ??​
    5·2 answers
  • Computer system analyst advantage​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!