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
You need to protect sensitive files from unauthorized users even if the disk is stolen. What feature should you use and on what
Lynna [10]

Answer:

EFS on NTFS

Explanation:

EFS (Encryption File System) allows users to store confidential information about a computer when people who have physical access to your computer could otherwise compromise that information, intentionally or unintentionally. EFS is especially useful for securing sensitive data on portable computers or on computers shared by several users.  An attacker can also steal a computer, remove the hard drive(s), place the drive(s) in another system, and gain access to the stored files. Files encrypted by EFS, however, appear as unintelligible characters when the attacker does not have the decryption key.

The Encrypting File System (EFS) that is included with the operating systems provides the core file encryption technology to store NTFS files encrypted on disk.

7 0
3 years ago
Will sum1 come bust me outta FCA....replies u gotta live in knoxville though
snow_tiger [21]

Answer:

im on my way cuz

Explanation:

4 0
3 years ago
Read 2 more answers
Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. Whic
USPshnik [31]
Internet tap and log on application
6 0
3 years ago
Read 2 more answers
Several users on the second floor of your company's building are reporting that the network is down. You go to the second floor
Juliette [100K]

The troubleshooting step that you should take next is to Question User.

<h3>What is Troubleshooting?</h3>

This refers to the diagnostics that is run on a computer program or system in order to find the problem that is causing it to malfunction or misbehave.

Hence, we can see that based on the fact that several users on the second floor of your company's building are reporting that the network is down and go to the second floor to investigate and find that you are able to access the network, the troubleshooting step that you should take next is to Question User.

Read more about troubleshooting here:

brainly.com/question/13818690

#SPJ1

3 0
2 years ago
You want to read input from the user to know how many apples they would like
Daniel [21]

Answer:

var applesToBuy = readLine("How many apples would you lik

e? ");

Explanation:

It asks the user to enter answer the question and it stores the answer into the applesToBuy variable.

Its right dont worry.

6 0
2 years ago
Other questions:
  • What is computer hacking? describe some examples
    6·1 answer
  • What is a sound wave
    7·2 answers
  • What is the difference between an electronic notebook and electronic flash cards?
    8·1 answer
  • In bankruptcy, most of a debtor’s assets will probably be used to repay unsecured debt
    9·1 answer
  • Write a Python program that takes a file name as input and generates the following output: File size in bytes and KBs Time the f
    12·1 answer
  • Write a program that will generate a personalized invitation within a text file for each guest in the guest list file using the
    15·1 answer
  • What is difference between base font and font tags​
    13·1 answer
  • MSWord is a popular___________ program.​
    7·2 answers
  • Html is a markup language that lets you identify common sections of a web page
    8·1 answer
  • compared to other data structures, this dbms structure is more flexible and stores data as well as instructions to manipulate th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!