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
Driving Distraction Brainstorming Session
Leto [7]

texting, phone calls, putting on makeup, brushing hair, movies playing in car, loud music, children, and that's pretty much all I could think of

please give <u>BRAINLIEST ANSWER └[T‸T]┘</u>

5 0
3 years ago
A consolidation test was performed on a sample of fine-grained soil sample taken from a depth such that the vertical effective s
Scorpion4ik [409]

Answer:

The settlement that is expected is 1.043 meters.

Explanation:

Since the pre-consolidation stress of the layer is equal to the effective stress hence we conclude that the soil is normally consolidated soil

The settlement due to increase in the effective stress of a normally consolidated soil mass is given by the formula

\Delta H=\frac{H_oC_c}{1+e_o}log(\frac{\bar{\sigma_o}+\Delta \bar{\sigma }}{\bar{\sigma_o}})

where

'H' is the initial depth of the layer

C_c is the Compression index

e_o is the inital void ratio

\bar{\sigma_o} is the initial effective stress at the depth

\Delta \bar{\sigma_o} is the change in the effective stress at the given depth

Applying the given values we get

\Delta H=\frac{8\times 0.3}{1+0.87}log(\frac{154+28}{154})=1.04

3 0
3 years ago
A hydraulic jump is induced in an 80 ft wide channel.The water depths on either side of the jump are 1 ft and 10 ft.Please calcu
krek1111 [17]

Answer:

a) 42.08 ft/sec

b) 3366.33 ft³/sec

c) 0.235

d) 18.225 ft

e) 3.80 ft

Explanation:

Given:

b = 80ft

y1 = 1 ft

y2 = 10ft

a) Let's take the formula:

\frac{y2}{y1} = \frac{1}{5} * \sqrt{1 + 8f^2 - 1}

10*2 = \sqrt{1 + 8f^2 - 1

1 + 8f² = (20+1)²

= 8f² = 440

f² = 55

f = 7.416

For velocity of the faster moving flow, we have :

\frac{V_1}{\sqrt{g*y_1}} = 7.416

V_1 = 7.416 *\sqrt{32.2*1}

V1 = 42.08 ft/sec

b) the flow rate will be calculated as

Q = VA

VA = V1 * b *y1

= 42.08 * 80 * 1

= 3366.66 ft³/sec

c) The Froude number of the sub-critical flow.

V2.A2 = 3366.66

Where A2 = 80ft * 10ft

Solving for V2, we have:

V_2 = \frac{3666.66}{80*10}

= 4.208 ft/sec

Froude number, F2 =

\frac{V_2}{g*y_2} = \frac{4.208}{32.2*10}

F2 = 0.235

d) El = \frac{(y_2 - y_1)^3}{4*y_1*y_2}

El = \frac{(10-1)^3}{4*1*10}

= \frac{9^3}{40}

= 18.225ft

e) for critical depth, we use :

y_c = [\frac{(\frac{3366.66}{80})^2}{32.2}]^1^/^3

= 3.80 ft

7 0
3 years ago
Read 2 more answers
Showing all of your work and algebra,generate an approximate expression for T as a function ofthe other variables. (b) Explain w
shusha [124]

Answer:

Following the ways of dealing with incomplete questions, i was able to get the complete question, please look at the attachment for ans.

5 0
4 years ago
Imagine you are a process safety consultant and you have been tasked to make a metal refinery site DSEAR compliant. What are the
masya89 [10]

Complying with DSEAR involves:

Assessing risks. ...

Preventing or controlling risks. ...

Control measures. ...

Mitigation. ...

Preparing emergency plans and procedures. ...

Providing information, instruction and training for employees. ...

Places where explosive atmospheres may occur ('ATEX' requirements)

hse uk

4 0
2 years ago
Other questions:
  • A circuit-switching scenario in whichNcs users, each requiring a bandwidth of 25 Mbps, must share a link of capacity 150 Mbps.
    12·1 answer
  • Radioactive wastes are temporarily stored in a spherical container, the center of which is buried a distance of 10 m below the e
    6·1 answer
  • suppose we number the bytes in a w-bit word from 0 (less significant) to w/8-1 (most significant). write code for the followign
    11·1 answer
  • The value of the critical Reynolds number for the flow over a flat plate is 5 x10^5. The significance of the value is:
    13·1 answer
  • Determine the magnitude and the location of the hydrostatic force on the 2m by 4 m vertical rectangular gate shown in Figure P3.
    12·1 answer
  • A rotor in a compressor stage has a mean blade radius of 0.285 m and an angular rotor velocity of 8500 RPMs. The static temperat
    9·1 answer
  • Writing an excellent problem statement will not help guide you through the rest of the process and steer you towards the BEST so
    8·1 answer
  • What information in drawing's title block identifies the project?
    12·1 answer
  • What is the effect of connecting
    8·1 answer
  • Chemical engineers determine how to transport chemicals.<br> O True<br> False
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!