Task-1: Write a C++ program that lets a user enter decimal integers for calculating some statistics. Values entered should be stored in a vector object. The program should present a menu-driven approach in which the inputting process should continue as long as the user wants. The program should calculate the minimum, maximum, mean, median, and standard deviation. The program should first sort the list in increasing order to calculate the median. * The mean formula: * =(E-1 ×i) E=,(xi-x)² * The standard deviation formula: s = n-1 * For sorting the values entered, you should use the insertion-sort algorithm shown below. Insertion-Sort(a) for j + 2 to a.length do hold + a[j] i + j-1 while i > e and a[i] > hold do a[i+1] + a[i] i + i-1 end-while a[i+1] € hold end-for
Q: As of C++11, you can ask a vector or deque to return unneeded memory to the system by calling member…
A: Given Data:- As of C++11, you can ask a vector or deque to return unneeded memory to the system by…
Q: Function: get_total_cases() takes the a 2D-list (similar to database) and an integer x from this…
A: According to the information given:- We have to create get_total_case() function to get 2D list of…
Q: Hello C++ question thank you 1) Develop a function that properly prints out each element of a…
A: The complete C++ code is given below with output and code screenshot A function(printelements) is…
Q: write a program in C++ that allows the user to enter 10 songs and their artists into a playlist and…
A: The code is written below- #include <iostream> #include<string> #include<cstdio>…
Q: In a loop, fill an array for up to 50 even numbers and a set for up to 50 odd numbers. Use the…
A: Since you have asked multiple questions in a single request, as per the policy, we will be answering…
Q: C++ Format Please Write a function called SortByUpper, that takes a vector of strings and changes…
A: Explanation: The vector is sorted by comparing second element of every row. We are assuming that the…
Q: oite a functión that returns a vector. The function will accept names (full names: Given, Middle, &…
A: Note: Answering the first question as per the guidelines. Input : Input the given name, middle…
Q: Create a soda beverage shopping cart program using C++ implementing the following: Linked List -…
A: Q: Create a soda beverage shopping cart program using C++ implementing the following: Linked List…
Q: Create a C++ Grocery Program according to this guideline: Linked List Functions Pointers Arrays The…
A: Problem 1 #include#include#include//define MAX items in list#define MAX 1000using namespace…
Q: subject : programming language: C + + Subject Write three C++ functions which accepts an array…
A: According to the question: Output:
Q: Given the Point structure defined below, complete the function that computes the length of a path…
A: A vector is a container of data items that can be manipulated using various inbuilt functions. Their…
Q: 9. A function's return type may not be an array. 10. An array must be initialized when it is…
A: array data structure: An array is a linear data structure that stores the elements start from the…
Q: CAN NOT write the Employee struct as a single struct. You will need to write it out field by field.…
A: #include <stdio.h> #include <stdlib.h> #include <string.h> #define…
Q: LessThan Program. Write a C++ program that include a function named LessTan. The function accepts…
A: #include <iostream>#include <vector>#include <cstdlib>#include <ctime>using…
Q: C programing language Implement a function that receives a pointer to the first character of a…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Write a C++ program that store radius of 10 circles in an array getting from user. It should…
A: The required C++ code is: #include <iostream> #define PI 3.14#define size 10using namespace…
Q: Create a dynamic array that contains an int array. dynamic array, array inside when the existing…
A: #include <stdio.h>#include <stdlib.h> int MAX_SIZE = 10;int n = 0; //A counter variable…
Q: In C programming language, choose True or False for the following statem Each question is 2 point.…
A: fscanf function returns a NULL pointer f end-of-file is reached Answer: True. A function which…
Q: Create a dynamic array that contains an int array. dynamic array, array inside when the existing…
A: According to the information given:- We have to create dynamic array for a link list in C language.
Q: 1. Write a function with vector as it's parameter. The function will accept names (full names:…
A: As per the qna policy, only first question is solved. Since you have not specified the programming…
Q: Q10) implement the following C++ program which includes the following members: 1) Implement the…
A: As specified in the implementation procedure, Steps performed: Initially, a readFile function…
Q: In C++: Define a function that reads input 5 integers from the user, stores them in a vector, and…
A: Define a C++ function that reads input 5 integers from the user, stores them in a vector, and then…
Q: Template Specialization in c++ is used to write generic code. Template code is written once and use…
A: Coded using C++.
Q: IN C++ The text file is the 5 lines below 1 1 1 1.2 -2.3 0.4 -2 -3 -4 +0 -2 8.85 2.345…
A: 1 1 1 1.2 -2.3 0.4 -2 -3 -4 +0 -2 8.85 2.345
Q: Computer Science A restaurant requires WAIT ADT to help waiter to wait tables. The application is…
A: #include<iostream>#include<string>//#include<Windows>using namespace std; class…
Q: ain.cpp #include #include #include using namespace std; // TODO: Write method to create and…
A: Step 1: Prompt and accept the string of names separated by spaces and ending with -1. Step 2:…
Q: A function can return a vector as a result. Write a function vecout that will receive one integer…
A: NOTE: Answering in MATLAB langauge as a programming language is not mentioned. We need to define a…
Q: 8. To pass a scalar variable by reference in C++, you need to include the ____ operator before the…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: C++ Provide a different implementation of ChoiceQuestion. Instead of storing the choices in a…
A: // ------------------------------ questiondemo.cpp ------------------------------ #include…
Q: Given a string that represents a matrix. Reshape the matrix into a new one with different…
A: Code: #include<stdio.h> #include<string.h> int main() { int len; //…
Q: Write a function occurs(vector, value) that counts the number of times that value occurs in vector.…
A: Program #include <iostream>#include <vector>#include <algorithm>using namespace…
Q: struct remove_from_front_of_vector { // Function takes no parameters, removes the book at the front…
A: Complete Code C++ struct remove_from_front_of_vector{ void operator()(const Book& unused )…
Q: Create a function that finds if the elements of a list is palindrome number or not, in python…
A: Read the input. Check if it is palindrome or not. If yes return true, or return false. Print the…
Q: Functions - Make sure that the rogram will have user-defined functions (e.g.: function for adding…
A: Create a soda beverage shopping cart program using C++ implementing the following: Linked List -…
Q: c++ problem Define a struct for a soccer player that stores their name, jersey number, and total…
A: C++ is a powerful general-purpose programming language which can be used to develop operating…
Q: Write a program that gets a list of integers (which are chosen from values between 0 and 8…
A: Use a function to calculate factorial and invoke this as soon as we consume user input and store the…
Q: If you have the following node declaration: struct Node { int number; struct Node * next; }; typedef…
A: Struct node:- A node is a struct with at least a data field and a reference to a node of the same…
Q: 1. Write a function with vector as it's parameter. The function will accept names (full names:…
A: Note: Answering the first question as per the guidelines. Input : Input given name, middle name,…
Q: Create a dynamic array that contains an int array. dynamic array, array inside when the existing…
A: The answer given as below:
Q: a. Write a C++ statement that declares secretList to be a vector object to store integers. (Do not…
A: a) vector<int> secretList;
Q: In C++, define an integer vector and ask the user to give you values for the vector. Because you…
A: According to the provided information, We have to create a module to find out the average of all…
Q: 1. Prompt the user to enter a vector of maximum 10 digits. Note: the vector entered can contain…
A: C code :- #include<stdio.h>int fun(int[],int,int);int main() { int n,arr[30],i;…
Q: A singly linked circular list is a linked list where the last node in the list points to the first…
A: 1. There are two classes in the program Item and Cart 2. Item class contains the Item attributes…
Q: FileAttributes.c 1. Create a new C source code file named FileAttributes.c preprocessor 2.…
A: FileAttributes.c 1. Create a new C source code file named FileAttributes.c preprocessor…
Q: JS Write a function named list_concat that has a single parameter. This parameter will be a…
A: <!DOCTYPE html><html><body> <h2>Concatenate Lists</h2> <p…
Q: Question 3. Write a function called simulate_several key_strikes It should take one argument an…
A: The program is written in python import stringimport random char=string.ascii_lowercase def…
Q: Create a dynamic array that contains an int array. dynamic array, array inside when the existing…
A: Create a dynamic array that contains an int array. dynamic array, array inside when the existing…
Q: Functions Pointers Arrays The program must have a menu layout where the user can select certain…
A: Create a C++ Grocery Program according to this guideline: Linked List Functions Pointers Arrays…
Q: Program # 1 You are use c++ to create a database of books that are stored using a vector. Keep…
A: Lets see the solution.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images
- Topic: pointers, dynamic array and command line arguments Write a complete C++ program named “showHelp” that accepts command line arguments. It checks whether there is a command line argument of “/help” or“/?” or “-help” followed by a topic number. It will print out “yes, topic number(<number>) if there is one. Otherwise, it prints out “no, topic number(N/A) For example, if you run this program with correct arguments as follows, it willprint out yes and its associated topic number respectivelyshowHelp /? 101showHelp /debug /help 102showHelp /print /help 103 /verboseshowHelp -verbose -debug -help And if you run the program with invalid arguments, it will print no, in all casesshowHelp -helpshowHelp 101 /?showHelp 101 102 /help /verboseshowHelp /? /help -helpNote: command line arguments are simply an array of pointers to C-string. example code: #include <iostream> using namespace std; int main(int argc, char** argv){...}Hello C++ question thank you 1) Develop a function that properly prints out each element of a vector of strings Print an endline character when done to make sure the next print starts on a new line make this function templated to the vector type passed in(Comment this) 2) Implement the following functionality using std::vector and std::string data types: a vector that contains the following strings as elements { olleh ereht skool ekil uoy desrever gnihtyreve gnidrocca ot nalp doog boj } Print the vector using your function Reverse all the letters in each string, so that each string is now a proper word Print the vector using your function a second "new" vector, copying the first vector's elements using iterators Do not copy the first two elements and the last two elements into the new vector Print the "new" vector using your function Sort the "new" vector alphabetically Print the "new" vector using your function Change every 'o' character in the "original" vector into a '@'…Using C/C++ programming language, solve the following problems.typedef structure {int phoneID; char phoneName[50];int price;int ramMemory;float cpuSpeed;int gpuMemory;char userName[50];int userPhoneNo;char userCountry[50];} SmartPhoneType;1. Write a program that will read 5 mobile’s information from the user and save it in a file named“mobileInfo.txt”.2. Write a function that will print all the information of a specific smart phone. Use the prototype -void printPhoneInfo(SmartPhoneType phoneType);3. Print all the information of the phone using the function mentioned in the Question 2 which hasthe highest price. Use the prototype -void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType*highestPricePhone);
- Using C/C++ programming language, solve the following problems. typedef structure { int phoneID; char phoneName[50]; int price; int ramMemory; float cpuSpeed; int gpuMemory; char userName[50]; int userPhoneNo; char userCountry[50]; } SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named “mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which has the highest price. Use the prototype - void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType *highestPricePhone); PLZ DO PART 1,2,3 MUCH EASY WAY ABOUT FILES LIKE "FILENAME.TXT","R") AND WITHOUT STDERR.Using C/C++ programming language, solve the following problems. typedef structure { int phoneID; char phoneName[50]; int price; int ramMemory; float cpuSpeed; int gpuMemory; char userName[50]; int userPhoneNo; char userCountry[50]; } SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named “mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which has the highest price. Use the prototype - void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType *highestPricePhone); TRY TO DO DIFFRENT WAYUsing C/C++ programming language, solve the following problems.typedef structure {int phoneID; char phoneName[50];int price;int ramMemory;float cpuSpeed;int gpuMemory;char userName[50];int userPhoneNo;char userCountry[50];} SmartPhoneType; 1) Write a program that will read 5 mobile’s information from the user and save it in a file named“mobileInfo.txt”. 2. Write a function that will print all the information of a specific smart phone. Use the prototype - void printPhoneInfo(SmartPhoneType phoneType) 3. Print all the information of the phone using the function mentioned in the Question 2 which hasthe highest price. Use the prototype -void getHighestPricePhone ( SmartPhoneType mobileList[], int size, SmartPhoneType*highestPricePhone); 4. Write a function that will find all the devices from a specific country and print the information using the function mentioned in the Question 2. Use the prototype - void countryWisePhone( SmartPhoneType mobileList[], int size, char *country); 5. write a…
- Your program must use the following five function headers exactly as they appear here: void getVectorSize(int& size); void readData(vector<Highscore>& scores); void sortData(vector<Highscore>& scores); vector<Highscore>::iterator findLocationOfLargest( const vector<Highscore>::iterator startingLocation, const vector<Highscore>::iterator endingLocation); void displayData(const vector<Highscore>& scores); The size parameter from the given code won't be needed now, since a vector knows its own size. using namespace std; const int MAX_NAME_SIZE = 24; struct Highscore{ char name[MAX_NAME_SIZE]; int score; }; void getArraySize(int& size); void readData(Highscore highScores[], int size); void sortData(Highscore highScores[], int size); int findIndexOfLargest(const Highscore highScores[], int startingIndex, int size); void displayData(const Highscore highScores[], int size); int main() { Highscore* highScores; int size;…PLEASE HELP IN FIXING THIS C++ CODE. I GET A LOT OF ERRORS BUT IT RUNS PERFECTLY IN AN ONLINE COMPILER. THANK YOU! THE CODE: #include <iostream>#include <vector> using namespace std; int main(){vector<char> TellerA;vector<char> TellerB;vector<char> TellerC;int timeItTakesA = 1;int timeItTakesB = 5;int timeItTakesC = 10;int runTimeA = 0;int runTimeB = 0;int runTimeC = 0;bool hasCustA = false;bool hasCustB = false;bool hasCustC = false;vector<vector> aCustomers = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};int curCount = aCustomers.size();int transCounter = 0;while(curCount > 0){transCounter++;if(!hasCustA){TellerA.push_back(aCustomers[0]);aCustomers.erase(aCustomers.begin());curCount = aCustomers.size();hasCustA = true;}runTimeA++;if(runTimeA == timeItTakesA){runTimeA = 0;hasCustA = false;} if(!hasCustB){TellerB.push_back(aCustomers[0]);aCustomers.erase(aCustomers.begin());curCount =…Why isn't my program working? // FinalExam.cpp : This file contains the 'main' function. Program execution begins and ends there.// James English// Create a Conncet 4 Game. #include <iostream>#include <string>#include <vector> using namespace std; class Player{public: string name; char piece; }; bool checkLine(vector<char>);void printBoard(vector< vector<char>>& board);void startGame();string makePlayer();void mainGameLoop(Player& p1, Player& p2);bool gameOver(vector< vector<char>>& board, int); int main(){ startGame(); } void startGame(){ Player p1; Player p2; p1.name = makePlayer(); p1.piece = 'X'; p2.name = makePlayer(); p2.piece = 'O'; mainGameLoop(p1, p2);} void mainGameLoop(Player& p1, Player& p2){ int n = 7; int m = 6; vector< vector<char> > board(n, vector<char>(m, ' ')); int play = 0; int turn = 0; while (!gameOver(board, play)) {…
- In C++ programming Language using Visual Studio(Not Visual Studio Code) Suppose you have a vector of integer data, say { 1, 5, 4, 2, 3 }The data may eventually need to be transformed into some other form, say by sorting the data values for instanceThis would turn the vector into { 1, 2, 3, 4, 5 }Or say I wanted to take the original vector { 1, 5, 4, 2, 3 } and remove all the even numbers from itThis would turn the vector into { 1, 5, 3 }So in general terms, we start with an input vector, and it somehow gets transformed into its transformed vectorThe options really are almost limitless, but we will keep things simple for this checkpoint assignmentWe will be developing a base/derived class relationship that can perform custom transformations of data at runtimeYour submission must follow OOP best practices that incorporates topics in Gaddis' textbook chapters 13 through 15 { 1, 5, 4, 2, 3 } ==========(SORT)==========> { 1, 2, 3, 4, 5 }{ 1, 5, 4, 2, 3 } ======(REMOVE EVENS)======>…# phyton A vector contains the grades obtained by students of a class in an assessment, with the following characteristics: Notes are actual values between zero and ten.If the value is equal to -1.0, then this means that the student has missed the assessment.The average approval rate at this University is 6 (six).Write a program that reads two vectors: the note vector described and a vector containing the students' names of the same size. As an output, print the following information in the console in this order: How many students missed the evaluation?How many students have been approved?Among the students present, how many students failed?Among the students present, what was the average grade, with up to two decimal places of accuracy?What's the name of the student who got the highest grade in the class?TipsCreate different counters to find the value of outputs 1 through 4. These counters are different from the loop counter that traverses the vector;Within the while loop, use five…C++ Dynamic Programs Hoskins College offers both curriculum and continuing education courses. Write a program that dynamically tracks these courses using an array of object pointers. Every course (both curriculum and continuing education) has a course id, title, room number, and number of contact hours. A curriculum course has credit hours and tuition rate. Tuition is calculated by multiplying the course's credit hours by tuition rate. A continuing education course has a flat fee (cost). Implement a show() function in every class that displays the data in the object. Part A: Create an inheritance-based collection of classes to represent these different courses. Include code in main to test your work by instantiating objects of the two derived classes. Part B: Modify your program. Remove the objects you created in main to test the classes. Modify the base class so that show() becomes a virtual class. In main, create a single array capable of holding pointers to objects of both…