1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nostrana [21]
2 years ago
10

Write a program that will sort an array of data using the following guidelines - DO NOT USE VECTORS, COLLECTIONS, SETS or any ot

her data structures from your programming language.
C++
Ask the user for the number of elements, not to exceed SORT_MAX_SIZE = 16 (put appropriate input validation)
Ask the user for the type of data they will enter - Dollar or CIS22C_Dollar objects from Lab 1.
Use your Dollar and CIS22C_Dollar classes from Lab 1 as-is without making any changes. If you do make changes to be able to complete this lab, then there will be a small penalty.
Based on the input, create an appropriate array for the data to be entered.
Write a helper function called RecurMergeSort such that: It is a standalone function not part of any class of Lab 1, Takes in the same type of parameters as any standard MergeSort with recursion behavior, i.e. void MergeSort(Dollar arr[], int size) Prints out how the array looks every time a recursive step returns back to its caller You might need to pass in a third parameter which identifies the array to be printed - this is language dependent.
In your main, allow the user to enter data of their own choosing up to their chosen array size. There is no sample output - you are allowed to provide user interactivity as you see fit but programs will be graded for clarity of interaction.
Then sort the array using your sort function of step 5.
Take screenshots to be uploaded with the project. In your main, make sure that the output is being written to console as well as an output file at the same time.
Do not copy and paste text from your console to create the output file.
Ensure input and any other data validations as needed and provide descriptive prompts with emphasis on usability. Upload your classes from Lab 1 and new code files for Lab 3, output file and the screenshots in one zip file.
The Dollar and CISDOLLAR class are as follows:
class Dollar // Dollar class
{
private:
int noteValue;
int coinValue;
string currencyName;
public:
Dollar() {}; // default constructor
Dollar(int note, int coin) { // parameterized constructor
noteValue = note;
coinValue = coin;
}
~Dollar() { // copy constructor
};
// setters and getters.
int getNoteValue() {
return noteValue;
}
void setNoteValue(int x) {
noteValue = x;
}
int getCoinValue() {
return coinValue;
}
void setCoinValue(int x) {
coinValue = x;
}
Dollar operator +(Dollar obj) {
Dollar obj2;
obj2.noteValue = noteValue + obj.noteValue;
obj2.coinValue = coinValue + obj.coinValue;
return obj2;
}
Dollar operator -(Dollar obj) {
Dollar obj2;
obj2.noteValue = this->noteValue - obj.noteValue;
obj2.coinValue = this->coinValue - obj.coinValue;
return obj2;
}
bool operator ==(Dollar obj) {
if ((this->noteValue == obj.noteValue) && (this->coinValue == obj.coinValue))
return true;
else
return false;
}
double dollarToCsdollar(int note, int coin) // converter from Dollar to CIS22CDollar
{
double amount = (note + coin * 0.01);
return amount * 1.36;
}
double dollarAmount(int note, int coin) //Total calculator for Dollar
{
cout << "Dollars:" << (note + coin * 0.01);
return (note + coin * 0.01);
}
};
class CIS22CDollar :public Dollar { // CIS22CDollar class, derived from Dollar Class;
private:
int noteValue;
int coinValue;
double conversionFactor;
double convertTo22C()
{
conversionFactor = 1.36;
return conversionFactor;
}
double convertToDollar() {
conversionFactor = 0.74;
return conversionFactor;
}
public:
CIS22CDollar() {}; //default constructor
CIS22CDollar(int note, int coin) { // parameterized constructor
noteValue = note;
coinValue = coin;
};
~CIS22CDollar() {}; // copy constructor
// Setters and getters.
int getNoteValue() {
return noteValue;
}
void setNoteValue(int x) {
noteValue = x;
}

int getCoinValue() {
return coinValue;
}
void setCoinValue(int y) {
coinValue = y;
}
double conversionToDollar(int note, int coin) { // converter to DOLLAR class
double amount = (note + coin * 0.001);
return amount * 0.74;
}
double cisDollarAmount(int note, int coin) { // total number of cents which is used later in code.
(note + coin * 0.01);
}
};
Computers and Technology
1 answer:
Rashid [163]2 years ago
4 0

Answer:

Explanation:

e=mx+b

You might be interested in
Carol typed a memo to send to everyone in her department. To create this memo, she used a _____.
aleksley [76]

she used a word processor

8 0
3 years ago
Read 2 more answers
What distinguishes Accenture’s Cloud capabilities from our competitors?
harina [27]

The things that differentiate Accenture’s Cloud capabilities from other competitors is allowing clients to choose the location, memory, and speed of the devices that they want to use.

Cloud computing refers to the delivery of several services through the internet. They're the tools and the applications like servers, databases, software, networking, etc.

Accenture’s Cloud capabilities are different from other competitors as it allows clients to choose the location and speed of the services that they want to enjoy.

Also, Accenture’s Cloud capabilities enable clients to host Cloud services using their own on-premise infrastructure.

Red related link on:

brainly.com/question/25557420

6 0
2 years ago
All websites with medical information should be considered credible.
larisa [96]
No, this is not true. WebMD is a great example asking you of simple symptoms that you may be facing and your results could present an apparent fatal disease. This constantly scares the population of netizens whenever they would want a quick diagnosis online through these medical information sites. The best solution to your symptoms is to visit your family doctor or a licensed physician who will give you proper diagnosis checking your vital signs and other related information. Do not always trust the internet and the information it gives you as a user you must take the information with discretion before reacting inappropriately. 
3 0
2 years ago
Read 2 more answers
The ____ option must be used when running a program in order to see the results of assert statements.
Lera25 [3.4K]

Answer:

-ea

Explanation:

We can enable or disable assertions in java, by default this assertions are disabled at runtime, but we can use two commands, for example, if we want to enable assertions at various granularities, we can use the -enableassertions, or -ea, switch, if we want to disable at various granularities, is -disableassertions, or -da.

4 0
3 years ago
Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti
Gemiola [76]

Answer:

b. cart total + 1

Explanation:

A. cart total=1 do increment the total with every 1 click here, it only 're-assigns cart total with value 1 for every click, hence it's always 1.

B. In every click, 1 is always added to the previous value of cart total, like addItemButton(cart total+1) or so.

C. This would have worked too if "cart total" and "cartTotal" where of same type.

D. cart total is just being initially defined here.

E. Likewise here, var shows that cart total has just only been declared.

6 0
2 years ago
Other questions:
  • Which is an example of withholding you might see on your pay stub
    14·2 answers
  • Look at the circuit shown in the figure above. Switch S1 is open as shown, and R1 and R2 each have a value of 100 k. If you conn
    11·1 answer
  • If a hypothesis is strongly supported by the scientific community based on compelling experiment results, it becomes a————
    10·2 answers
  • To support continuous improvement efforts in the workplace, you increase the number of tasks that an employee performs and have
    7·1 answer
  • Is a book considered technology?
    8·2 answers
  • I wanna start answering questions for people, but I don't quite know how. Can you help me?​
    13·1 answer
  • Anybody know this question??
    8·1 answer
  • Why is information broken down into packets
    15·1 answer
  • Very Short Answer Type Question (any 9)
    12·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!