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
The air in a room has a pressure of 1 atm, a dry-bulb temperature of 24C, and a wet-bulb temperature of 17C. Using the psychrome
TEA [102]

Answer:

(a) Relative Humidity = 48%,

Specific humidity = 0.0095

(b) Enthalpy = 65 KJ/Kg of dry sir

Specific volume = 0.86 m^3/Kg of dry air

(c/d) 12.78 degree C

(e) Specific volume = 0.86 m^3/Kg of dry air

8 0
3 years ago
Three tool materials (high-speed steel, cemented carbide, and ceramic) are to be compared for the same turning operation on a ba
Tpy6a [65]

Answer:

Among all three tools, the ceramic tool is taking the least time for the production of a batch, however, machining from the HSS tool is taking the highest time.

Explanation:

The optimum cutting speed for the minimum cost

V_{opt}= \frac{C}{\left[\left(T_c+\frac{C_e}{C_m}\right)\left(\frac{1}{n}-1\right)\right]^n}\;\cdots(i)

Where,

C,n = Taylor equation parameters

T_h =Tool changing time in minutes

C_e=Cost per grinding per edge

C_m= Machine and operator cost per minute

On comparing with the Taylor equation VT^n=C,

Tool life,

T= \left[ \left(T_t+\frac{C_e}{C_m}\right)\left(\frac{1}{n}-1\right)\right]}\;\cdots(ii)

Given that,  

Cost of operator and machine time=\$40/hr=\$0.667/min

Batch setting time = 2 hr

Part handling time: T_h=2.5 min

Part diameter: D=73 mm =73\times 10^{-3} m

Part length: l=250 mm=250\times 10^{-3} m

Feed: f=0.30 mm/rev= 0.3\times 10^{-3} m/rev

Depth of cut: d=3.5 mm

For the HSS tool:

Tool cost is $20 and it can be ground and reground 15 times and the grinding= $2/grind.

So, C_e= \$20/15+2=\$3.33/edge

Tool changing time, T_t=3 min.

C= 80 m/min

n=0.130

(a) From equation (i), cutting speed for the minimum cost:

V_{opt}= \frac {80}{\left[ \left(3+\frac{3.33}{0.667}\right)\left(\frac{1}{0.13}-1\right)\right]^{0.13}}

\Rightarrow 47.7 m/min

(b) From equation (ii), the tool life,

T=\left(3+\frac{3.33}{0.667}\right)\left(\frac{1}{0.13}-1\right)\right]}

\Rightarrow T=53.4 min

(c) Cycle time: T_c=T_h+T_m+\frac{T_t}{n_p}

where,

T_m= Machining time for one part

n_p= Number of pieces cut in one tool life

T_m= \frac{l}{fN} min, where N=\frac{V_{opt}}{\pi D} is the rpm of the spindle.

\Rightarrow T_m= \frac{\pi D l}{fV_{opt}}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 47.7}=4.01 min/pc

So, the number of parts produced in one tool life

n_p=\frac {T}{T_m}

\Rightarrow n_p=\frac {53.4}{4.01}=13.3

Round it to the lower integer

\Rightarrow n_p=13

So, the cycle time

T_c=2.5+4.01+\frac{3}{13}=6.74 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times6.74+\frac{3.33}{13}=\$4.75/pc

(e) Total time to complete the batch= Sum of setup time and production time for one batch

=2\times60+ {50\times 6.74}{50}=457 min=7.62 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times4.01}{457}=0.4387=43.87\%

Now, for the cemented carbide tool:

Cost per edge,

C_e= \$8/6=\$1.33/edge

Tool changing time, T_t=1min

C= 650 m/min

n=0.30

(a) Cutting speed for the minimum cost:

V_{opt}= \frac {650}{\left[ \left(1+\frac{1.33}{0.667}\right)\left(\frac{1}{0.3}-1\right)\right]^{0.3}}=363m/min [from(i)]

(b) Tool life,

T=\left[ \left(1+\frac{1.33}{0.667}\right)\left(\frac{1}{0.3}-1\right)\right]=7min [from(ii)]

(c) Cycle time:

T_c=T_h+T_m+\frac{T_t}{n_p}

T_m= \frac{\pi D l}{fV_{opt}}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 363}=0.53min/pc

n_p=\frac {7}{0.53}=13.2

\Rightarrow n_p=13 [ nearest lower integer]

So, the cycle time

T_c=2.5+0.53+\frac{1}{13}=3.11 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times3.11+\frac{1.33}{13}=\$2.18/pc

(e) Total time to complete the batch=2\times60+ {50\times 3.11}{50}=275.5 min=4.59 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times0.53}{275.5}=0.0962=9.62\%

Similarly, for the ceramic tool:

C_e= \$10/6=\$1.67/edge

T_t-1min

C= 3500 m/min

n=0.6

(a) Cutting speed:

V_{opt}= \frac {3500}{\left[ \left(1+\frac{1.67}{0.667}\right)\left(\frac{1}{0.6}-1\right)\right]^{0.6}}

\Rightarrow V_{opt}=2105 m/min

(b) Tool life,

T=\left[ \left(1+\frac{1.67}{0.667}\right)\left(\frac{1}{0.6}-1\right)\right]=2.33 min

(c) Cycle time:

T_c=T_h+T_m+\frac{T_t}{n_p}

\Rightarrow T_m=\frac{\pi \times 73 \times 250\times 10^{-6}}{0.3\times 10^{-3}\times 2105}=0.091 min/pc

n_p=\frac {2.33}{0.091}=25.6

\Rightarrow n_p=25 pc/tool\; life

So,

T_c=2.5+0.091+\frac{1}{25}=2.63 min/pc

(d) Cost per production unit:

C_c= C_mT_c+\frac{C_e}{n_p}

\Rightarrow C_c=0.667\times2.63+\frac{1.67}{25}=$1.82/pc

(e) Total time to complete the batch

=2\times60+ {50\times 2.63}=251.5 min=4.19 hr.

(f) The proportion of time spent actually cutting metal

=\frac{50\times0.091}{251.5}=0.0181=1.81\%

3 0
3 years ago
When replacing a timing belt, many experts and vehicle manufacturers recommend that all of the following should be replaced exce
lora16 [44]

Answer:

Correct Answer:

A. water pump

Explanation:

<em>Timing belt in a vehicle helps to ensure that crankshaft, pistons and valves operate together in proper sequence.</em> Timing belts are lighter, quieter and more efficient than chains that was previously used in vehicles.

<em>Most car manufacturers recommended that, when replacing timing belt, tension assembly, water pump, camshaft oil seal should also be replaced with it at same time. </em>

7 0
3 years ago
Transcript
posledela

Answer:

O is truse is the best answer hhahahha

Explanation:

8 0
3 years ago
The B-pillar may also be called the:
slega [8]

Answer:

if you're talking about the car b-post, the answer is "posts"

Explanation:

looked it up

6 0
2 years ago
Other questions:
  • Consider a circular grill whose diameter is 0.3 m. The bottom of the grill is covered with hot coal bricks at 961 K, while the w
    10·1 answer
  • An approach to a signalized intersection has a saturation flow rate of 1800 veh/h. At the beginning of an effective red, there a
    15·1 answer
  • The air loss rate for a straight truck or bus with the engine off and the brakes
    11·1 answer
  • PLEASE HELPPPPPPP!!!!,
    10·2 answers
  • Question text
    11·1 answer
  • A linear frequency-modulated signal makes a good test for aliasing, because the frequency moves over a range. This signal is
    6·1 answer
  • The Environmental Protection Agency (EPA) has standards and regulations that says that the lead level in soil cannot exceed the
    13·1 answer
  • Whats viruses c liver?
    14·2 answers
  • Technician A says that a circuit with continuity reads 0 ohms. Technician B says that an open circuit reads 0 ohms. Who is corre
    12·1 answer
  • Briefly explain the term soil sampling and outline its importance in building engineering works.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!