Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write this code in C# using OOP. function for input, function for output, and function for calculation using System; using System.Collections.Generic; using System.Diagnostics; using System.IO;

write this code in C# using OOP. function for input, function for output, and function for calculation
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; namespace ConsoleApplication // project name { class Program // program name { static void Main(string[] args) { float cost,pay; int[] Array={0,0,0,0,0,0,0,0}; float[] A={20,10,5,1,0.25f,0.10f,0.05f,0.01f}; int size=A.Length; Console.Write("Enter cost of an item: "); cost = float.Parse(Console.ReadLine()); Console.Write(" Enter amount the user is paying: "); pay = float.Parse(Console.ReadLine()); float remain=pay-cost; int i=0; for(i=0;i=A[i]) { int temp=(int)(remain/A[i]); remain-=temp*A[i]; Array[i]=temp; } } for(i=0;i

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

More Books

Students also viewed these Databases questions