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
An automotive piston's connecting rod is 8 inches long. What is the approximate length of this connecting rod in millimeters?
miv72 [106K]
42 millimeters the answer is 42 mill millimeters
7 0
3 years ago
Gear friction reduces power and engineers never use more gears than are need it.
tiny-mole [99]

Answer:

i personally think it is false

Explanation:

i think this because gear friction reduces next to no power

7 0
3 years ago
Read 2 more answers
If datums are used as suggested below (A datum on shaft, B datum on face below the head, C datum on the hex flat) and order of p
allsm [11]

Answer:

a. Use datum on shaft

b. Use datum on hex flat

c. Use datum on face below the head

d. Use datum on shaft

When these datum are used, they will prevent translation and rotation along axis which they act.

6 0
4 years ago
A beam spans 40 feet and carries a uniformly distributed dead load equal to 2.2 klf (not including beam self-weight) and a live
salantis [7]

Answer:

A beam is a structural member that is subjected primarily to transverse loads ... stress equal to σy, then the section Moment - Curvature (M-φ) response for .... Example 2.2 Design a simply supported beam subjected to uniformly distributed dead ... (live load). • Step I. Calculate the factored design loads (without self-weight).

Explanation:

6 0
3 years ago
Please view the file attached below and help me answer all the questions!!
evablogger [386]

Answe whats the question i can help you

Explanation:

8 0
3 years ago
Other questions:
  • A computer has a two-level cache. Suppose that 60% of the memory references hit on the first level cache, 35% hit on the second
    12·1 answer
  • What is the effect of the workpiece specific cutting energy on the cutting forces, and why?
    5·1 answer
  • Your application must generate: - an array of thirteen random integers from 1-99, - then prompt the user to select a sorting opt
    11·1 answer
  • The convection coefficient for flow over a solid sphere may be determined by submerging the sphere, which is initially at 25 °C,
    10·1 answer
  • Air at 80 °F is to flow through a 72 ft diameter pipe at an average velocity of 34 ft/s . What diameter pipe should be used to
    10·2 answers
  • Bridge Reflection:
    10·1 answer
  • HELP PLEASE!!!!
    12·1 answer
  • How can I skip more helppppppppppppppppppppppp
    9·2 answers
  • How does a Red Team versus Blue Team exercise help an organization?
    9·1 answer
  • What is the likely difference between urban planning for a very old city and urban planning for a new community built very recen
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!