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
In a linked chain implementation of a queue, the performance of the enqueue operation
alexdok [17]

Answer:

A.O(1)

Explanation:

In the implementation of queue by using linked chain the performance of  the enqueue operation is O(1).We have to  maintain  two pointers one  head and the other tailand  for  enqueue operation  we have to insert element  to the next of the tail and then  make that element  tail.Which takes O(1) time.

4 0
3 years ago
Given an int variable k that has already been declared, use a while loop to print a single line consisting of 88 asterisks. Use
Grace [21]

Answer:

True

Explanation:

The while loop is going to be executed until the condition is false.

Since <em>k</em> is initially equal to 1, the loop will execute 88 times. One asterisk will be printed and <em>k</em> will be incremented by one during each iteration.

When <em>k</em> becomes 89, the condition will be false (89 is not smaller or equal to 88) and the loop will stop.

6 0
2 years ago
A friend of yours started her own dog walking business. At first she only had a couple customers, and she used Word to create al
GaryK [48]
Hire more people to help type her documents, or make Batch invoices
4 0
3 years ago
Which of the following could occur when both strong and weak ciphers are configured on a VPN concentrator? (Select TWO) A. An at
Elza [17]

Answer:

A. An attacker could potentially perform a downgrade attack.

E. The IPSec payload reverted to 16-bit sequence numbers.

Explanation:

When both strong and weak ciphers are configured on a VPN concentrator, the following are likely to occur;

An attacker could potentially perform a downgrade attack

The IPSec payload reverted to 16-bit sequence numbers

3 0
3 years ago
Which of the following CANNOT be done in Normal view A. Enter bolded text in the Notes Pane B. Delete previously entered notes i
blondinia [14]

Answer:

<em>Well, Your answer will be is </em><em>B. Delete previously entered notes in the Notes Pane. Good Luck!</em>

3 0
3 years ago
Other questions:
  • What could prevent earmuffs from providing your ears good protection from noise?
    10·1 answer
  • In general, use no more than _____ font types in a worksheet.
    11·1 answer
  • The email program shipped with Microsoft office
    15·1 answer
  • 2.1 Changes in which factors could cause aggregate demand to shift from AD to AD1? What could happen to the unemployment rate? W
    8·1 answer
  • Syntax errors ________. a. result from an attempt to perform an operation that cannot executeb. are errors such as misspelled ke
    14·1 answer
  • Provides images of weather systems, and helps to track storms at different altitudes
    7·1 answer
  • Problem: Mr. James Reid, the director of admissions at MOGCHS University, has
    14·1 answer
  • Find what the secret message is. Get Brainliest if you are fast and correct.
    13·2 answers
  • Which of the following is not the disadvantage of closed
    7·2 answers
  • The technique that allows you to have multiple logical lans operating on the same physical equipment is known as a.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!