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
Ellen is expecting to get a 3% raise next year. She enters .03 in cell D2 so that she can predict her monthly income for the nex
Korolek [52]

Answer: F4

Explanation:

Absolute reference means that we can use a formula for a cell in a Excel and that formula for that particular cell will not be changed even if we copy or drag that formula to some part of the cell.

Excel offers us with the solution of applying formulas to different part of the cells which are indicated by the $ sign. So as in the question Ellen as she is expecting a 3% raise net year in her monthly column, So she can use absolute reference. She enters .03 which is 3 divided by 100 in the monthly income column. So in that column she has to type = for the formula to begin. Then the formula which is .03 and followed by F4 which is used to make the cell D2 absolute reference.

So next time upon referencing cell D2, we would get the value according to the formula.

3 0
3 years ago
Demote the "Arrive and leave at the same time each day." List item, and then promote the "Respect" list item.
garri49 [273]

Answer:

Dear

<h3>You should wear something professional. A tie, suit, classy dress, heels. You are more likely to be hired if you make it look like you take pride in your appearance. Also, depending on what kind of job you are applying for, the outfits can vary as well.</h3>

Explanation:

Black is too formal for interviews, and earth tones are too casual. Two-button suits are the professional standard.

7 0
3 years ago
What is the output <br>this is a computer science question ​
olga2289 [7]

Answer:

output is a last step of IPO cycle in which we can get meaningful information through output devices

6 0
3 years ago
How can learning opportunities for AI be extended to all
statuscvo [17]

Answer:

Learning opportunities for AI can be extended to all through the inclussion of courses and different teaching methods related to Artificial Intelligence, new technologies, computer science, programming and, in short, everything related to the digital world, in the educational plans at the national level. This is so because artificial intelligence and computer systems are the basis for the development of the new tools jobs of tomorrow. Thus, education in these subjects is essential so that citizens can enter the labor market once they acquire the necessary age, having the knowledge to do so in a proper way.

6 0
2 years ago
When you connect to an Access database, which entities are shown in the Navigator window?
Leni [432]

1DFASDFAASDASDFASDFADSFASFD

4 0
2 years ago
Read 2 more answers
Other questions:
  • When saving a file, you must provide a valid file name that adheres to specific rules, referred to as _______________.
    5·1 answer
  • Crash proof cars... do you have any idea on how to improve this idea
    13·2 answers
  • The first time you save a document, which screen appears
    8·2 answers
  • A(n) _____ is a type of server that stores computer software, which users can access from their workstations.
    6·1 answer
  • Write a program that asks the user for three names, then prints the names in reverse order.
    5·1 answer
  • What is the difference between a rack and a tower?
    8·1 answer
  • What is a Stereo In (&amp; Out) in audio?
    7·1 answer
  • Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well
    13·1 answer
  • With
    10·2 answers
  • A CPU has just been powered on and it immediately executes a machine code instruction. What is the most likely type of instructi
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!