C++ Visual Studios - Program - Vector -
Simple
Create a program that utilizes VECTOR for the following
topic.
Topic: Carl's Cab Stand needs a program to keep
track of their daily clients. Your program shall allow the user to
enter 10 names. You will then retrieve the names, one by one, from
the data structure (using the appropriate method of retrieval for
each data structure) and present them on-screen so that Carl knows
who to service next. Include a printed line at the end of the
program stating which is the preferred data structure for this
task.
Bonus: Sort the names alphabetically and reprint
the names to the screen after sorting.
Please find the code below::::
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void getClientName(vector<string> &names){
string name;
for(unsigned int i=0;i<10;i++){
cout<<"Enter Name
"<<i+1<<" : ";
cin>>name;
names.push_back(name);
}
}
void sortName(vector<string> &names){
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
if(names[i]<names[j]){
string temp = names[i];
names[i] = names[j];
names[j]= temp;
}
}
}
}
void printName(vector<string> &names){
cout<<"\nName sorted
alphabatically"<<endl;
for(unsigned int i=0;i<10;i++){
cout<<names[i]<<endl;
}
}
int main() {
vector<string> names;
getClientName(names);
sortName(names);
printName(names);
}
output:

C++ Visual Studios - Program - Vector - Simple Create a program that utilizes VECTOR for...
C++ Visual Studios Program - Simple The program must use a Vector. Topic: Carl's Cab Stand needs a program to keep track of their daily clients. Your program shall allow the user to enter 10 names. You will then retrieve the names, one by one, from the data structure (using the appropriate method of retrieval for each data structure) and present them on-screen so that Carl knows who to service next. Include a printed line at the end of the...
Include the blackbox output done with C# microsoft visual
studios software.
write a C# program to sort a parallel array that consists of customer names and customer phone numbers. The solution should be in ascending order of customer names. For instance, if the input is string[] custNames- { "ccc", "ddd", "aaa", "bbb" }; stringl] custIds687-3333", "456-4444", "789-1111", "234-2222" ; then, the solution is string[] string[] custNames- { "aaa", "bbb", "ccc", "ddd" }; custIds"789-1111", "234-2222", "687-3333", "456-4444"]; There are some restrictions:...
Visual C#
Homework 2
You are to write a program which will create a class called
Student
Each student has a name age height and weight. These variables
should be declared as private.
Create the correct constructors and functions.
In the main, you will create 5 students.
Input the data for the 5 students from a file which already
has information in it. Name the file “Information.txt”.
After setting up all the data, it is time to sort based on...
Project 2 Sorting, CPU Time, and Big O Analysis Note: you will be using Microsoft Visual Studios 2019 as the compiler. This is an individual assignment. You will have lab time to work on this assignment as well as homework time. Each person will analyze two sorts. The first sort will be either bubble sort or insertion sort. The second sort will be either quick sort or merge sort. Create two projects, one for each sort in the given choices....
Write a complete C++ program that will: Declare a vector of integers Use a pointer to dynamically allocate an array of 10 elements Ask the user how many values they would like to have in the data structures Read in the user’s response and make sure that it is greater than 20 (error loop) Generate the number of integers that the user asked for and store them into both data structures. The integer values should be unique unordered values (no...
MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...
MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...
please use C++ write a program to read a textfile containing a list of books. each line in the file has tile, ... Question: Write a program to read a textfile containing a list of books. each line in the file has tile, ..... write a program to read a textfile containing a list of books. each line in the file has tile, ... Question: Write a program to read a textfile containing a list of books. Each line in...
Write a C++ console program that defines a class named Course that utilizes a dynamically allocated array. Do not use the vector class for this assignment. The Course class should define private data members for the name of the course, the number of students in the course, an array of student names (string*), and the capacity of the course (the array may not be full of students). Use pointer notation when dealing with the array. A 2-arg constructor should initialize...
THIS MUST BE DONE ON VISUAL STUDIO Write a C# program that computes a the cost of donuts at your local Rich Horton’s store. The cost, of course, depends on the number of donuts you purchase. The following table gives the break down: Donuts Purchased Cost per Donut ($) = 15 0.75 A customer can save on the HST (13%) if they buy 12 or more donuts so only charge HST (use a constant) on the purchase if the customer...