Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It is the promotional season and everybody can buy the second item for half price. You will be given the amount bought ( n r.

image text in transcribed
It is the promotional season and everybody can buy the second item for half price. You will be given the amount bought ( n r. of items) and the unit price of n items. Calculate the total price. Input specification: You will be first given an integer (n), then in the following n lines you will be given two integers. Nr of items: which can be only one or two. Unit price of each item: an int. Output specification: Show one floating point number with two-digits precision: the total price

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

Developing and delivering learning that is integrated with the job.

Answered: 1 week ago

Question

Use of assessments to determine trainees learning styles.

Answered: 1 week ago