subject

Once upon a time there was a country called plusplusland. the monetary system they used there was simple: the currency name was the "plussar" and their central bank issued five different banknotes of values 50, 20, 10, 5 and 1 plussar. your task is to write a program for the atms of plusplusland. the program should find the minimal number of banknotes needed to deliver any amount of money to the client. the treasury minister has asked you personally to do this. he expects your code to print the values of all the needed banknotes in a row – this is the format accepted by all atms in plusplusland. your program will require the use of an integer array combined with different loops to process the currency. test your code using the sample data provided input125example output50 50 20 5example input127example output50 50 20 5 1 1example input49example output20 20 5 1 1 1 1(hint: here is an array that maybe for all known banknotes ordered from the most valuable to the leastint banknotes[] = {50, 20, 10, 5, 1} and then use your skill with array related processing combining different kinds of loops)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences.a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
question
Computers and Technology, 25.06.2019 06:30
How are slides deleted from a presentation?
Answers: 1
You know the right answer?
Once upon a time there was a country called plusplusland. the monetary system they used there was si...
Questions
question
Biology, 22.11.2019 22:31
Questions on the website: 13722360