
Concept explainers
Modify the following code with the comment
include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
int main(void) {
int arr[2][2] ={{500, 1000}, {750, 325}};
char name, acc_type;
int amt;
printf("\nEnter your name:")
scanf("%c", &name) ;
getchar();
printf("\nWould you like you withdraw from (c) Checkings or (s) Savings:") ;
scanf("%c", &acc_type) ;
printf("\nHow much would you like to withdraw:");
scanf("%d", &amt);
if(name == 'a')
{
switch(acc_type)
{
case c: printf("\n Amount in account to be withdrawn from: 500");
printf("\nAmount in account after withdrawal:%d",500-amt);break;
case s: printf("\n Amount in account to be withdrawn from: 1000);printf("\nAmount in account after withdrawal:%d",1000-amt);break;
}
}
if(name=='b')
{
switch(acc_type)
{
case c: printf("\n Amount in account to be withdrawn from: 750"); printf("\nAmount in account after withdrawal:%d",750-amt);break;
case s: printf("\n Amount in account to be withdrawn from:325");printf("\nAmount in account after withdrawal:%d",325-amt);break;
}
}
(if(amt >=100)
{
n100 = amt/100;
amt -= n100 * 100;
for(int i =0;i<n100;i++)
{
printf("\n$100 bill");
}}
if(amt>=50)
{
n50 = amt/50;
amt -= n50* 50;
for(int i =0;i<50;i++)
{
printf("\n$50 bill");
}
}
if(amt>=20)
{
n20 = amt/20;
amt -= n20 * 20;
for(int i =0;i<n20;i++)
{
printf("\n$20 bill");
}
}
if(amt >=10)
{
n10 = amt/10;
amt -= n10 * 10;
for(int i =0;i<n10;i++)
{
printf("\n$10 bill");
}
}
if(amt>=5)
{
n5 = amt/5;
amt -= n5* 5;
for(int i =0;i<n5;i++)
{
printf("\n$5 bill");
}
}
if(amt>=1)
{
n1=amt;
for(int i =0;i<n1;i++)
{
printf("\n$1 bill");
}
}
return 0;
}

Step by stepSolved in 4 steps with 3 images

- use c++ Programming language Write a program that creates a two dimensional array initialized with test data. Use any data type you wish . The program should have following functions: .getAverage: This function should accept a two dimensional array as its argument and return the average of each row (each student have their average) and each column (class test average) all the values in the array. .getRowTotal: This function should accept a two dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the total of the values in the specified row. .getColumnTotal: This function should accept a two dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a column in the array. The function should return the total of the values in the specified column. .getHighestInRow: This function should accept a two…arrow_forward#include <iostream> #include <iomanip> #include <string> #include <vector> using namespace std; class Movie { private: string title = ""; int year = 0; public: void set_title(string title_param); string get_title() const; // "const" safeguards class variable changes within function string get_title_upper() const; void set_year(int year_param); int get_year() const; }; // NOTICE: Class declaration ends with semicolon! void Movie::set_title(string title_param) { title = title_param; } string Movie::get_title() const { return title; } string Movie::get_title_upper() const { string title_upper; for (char c : title) { title_upper.push_back(toupper(c)); } return title_upper; } void Movie::set_year(int year_param) { year = year_param; } int Movie::get_year() const { return year; } int main() { cout << "The Movie List program\n\n"…arrow_forward//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





