Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

programming 2 (C++) please write the codes CLEARLY, with the input/output Define the struct Medicine that has the components name, disease of type string, dosage

programming 2 (C++)
please write the codes CLEARLY, with the input/output
image text in transcribed
Define the struct Medicine that has the components name, disease of type string, dosage of type integer, and price of type float. Define the following functions: voidinput(Medicine&);voidoutput(Medicine);MedicineextraMedicine(Medicine);//readsdatainthestructvariable//printsthedataofthestructvariable//modifythedosagebyadding30%,thepricebyadding//25%,andthenamebyaddingtheprefix"extra" Use the following main program: int maing \{ Medicine mQne, mTwo; input(mQne); output(mQne); mive = sxtraledicine (m9me); output(mJwo); 3 return 0 ; Sample input/output: Enter the name of the medicine: Panadol Enter the disease name: Headache Enter the dosage: 10 Enter the price: 13 The name of the medicine is: Panadol The disease name is: Headache The dosage is: 10 The price is: 13 The name of the medicine is: PanadolExtra The disease name is: Headache The dosage is: 13 The price is: 16.25

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions