If you've ever opened your computer's device manager, you've likely seen a whole list of devices, ranging from the obvious (keyboards, printers, monitors) to the internal (processors, memory, host controllers), to the subtle (network hosts, laptop lid closing, internal clock). While these devices can fall in a number of categories (input devices, graphics devices, audio devices, etc), they all share some features in common (they all have a name, a device driver, etc). In this section, we will design a very rudimentary implementation of a generic device driver. We are only interested in three things for the time being: the name of the device, an ID number identifying the device, and a flag indicating whether or not it is enabled. Thus, three fields are necessary, a String for the name, a int for the ID, and a boolean for the enabled status.
Any data elements should be declared private. If you think it is necessary you may include helper methods of your own. The class should implement the following public methods:
In: Computer Science
8.13 LAB: Warm up: Contacts
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
(2) Build the ContactNode class per the following specifications:
Parameterized constructor. Parameters are name followed by phone number.
Public member functions
Private data members
Ex. of PrintContactNode() output:
Name: Roxanne Hughes Phone number: 443-555-2864
(3) In main(), prompt the user for three contacts and output the
user's input. Create three ContactNodes and use the nodes to build
a linked list. (2 pts)
Ex:
Person 1 Enter name: Roxanne Hughes Enter phone number: 443-555-2864 You entered: Roxanne Hughes, 443-555-2864 Person 2 Enter name: Juan Alberto Jr. Enter phone number: 410-555-9385 You entered: Juan Alberto Jr., 410-555-9385 Person 3 Enter name: Rachel Phillips Enter phone number: 310-555-6610 You entered: Rachel Phillips, 310-555-6610
(4) Output the linked list. (2 pts)
Ex:
CONTACT LIST Name: Roxanne Hughes Phone number: 443-555-2864 Name: Juan Alberto Jr. Phone number: 410-555-9385 Name: Rachel Phillips Phone number: 310-555-6610
main.cpp:
#include <iostream>
using namespace std;
int main() {
/* Type your code here. */
return 0;
}
__________________
ContactNode.cpp
/* Type code here */
_________________
ContactNode.h
/* Type code here */
In: Computer Science
Modify the following code to make the input and output look like this.
Input
5 Vader 1300 Kirk 1250 Adama 1000 Reynolds 1615 Oneill 1470
Output
Enter the number of candidates: 5 Enter candidate's name :Vader 1300 Enter votes received :Enter candidate's name :Kirk 1250 Enter votes received :Enter candidate's name :Adama 1000 Enter votes received :Enter candidate's name :Reynolds 1615 Enter votes received :Enter candidate's name :Oneill 1470 Enter votes received : Name Votes Percentage Vader 1300.00 19.59% Kirk 1250.00 18.84% Adama 1000.00 15.07% Reynolds 1615.00 24.34% Oneill 1470.00 22.16% Total 6635 The Winner of the Election is Reynolds
//Abduljabbr sale11/8/2019//
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int size;
cout<<"Enter the number of candidates: ";
cin>>size;
string *names= new string[size];
double *votes=new double[size];
double sum=0;
double winner=-1;
string winnerName="";
int total=0;
//reading votes
for(int i=0;i<size;i++){
cout<<"Enter candidate's name :";
cin>>names[i];
cout<<"Enter votes received :";
cin>>votes[i];
sum+=votes[i];
//finding the winner
if(winner<votes[i]){
winner=votes[i];
winnerName=names[i];
}
}
cout<<endl;
//printing the data
cout << setprecision(2)<<fixed;
cout<<setw(20) << left
<<"Name"<<setw(20) << left
<<"Votes"<<setw(20) << left
<<"Percentage"<<endl;
for(int i=0;i<5;i++){
cout<<setw(20) << left<<names[i]<<setw(20)
<< left
<<votes[i]<<votes[i]/sum*100<<"%"<<endl;
total+=votes[i];
}
cout<<setw(20) << left<<"Total"<<setw(20)
<< left <<total<<endl;
cout<<"The Winner of the Election is
"<<winnerName;
return 0;
}
In: Computer Science
Assignment #2*: Build A Report Purpose: Exercise, use, Inputs, Outputs, and perform conditional evaluation Requirements: (Multiple classes/Multiple types of input) • Input: Report Owner’s full name and 7 numbers (at least one double and one integer) o The owner’s name cannot contain any special characters, blank spaces, or numbers • You must use an if statement and at least one switch statement in your program • You are not allowed to have static variables or methods in any class except for the class with the main method. • You have to have at least 2 classes • You are not allowed to use ArrayLists or Vectors, only primitive arrays or string arrays if you want. Application Operation: 1.) Input, via a question in the console, the report owner’s first name as a string and build the last name via input, one character at a time. a. Check, conditionally, to make sure the first name and last name don’t contain any numeric characters, numbers between 0 – 9. If it does you must remove it. The names can not contain any white space either or special characters. 2.) Input report name via a request from the console. 3.) Input, and display, the total of the numeric input after each input is entered. Average the numeric input, indicate lowest numeric input value and the highest numeric input value for the previous numeric inputs, before the next numeric input is asked for. (Example given in class) 4.) Have a program exit input, condition, value available (i.e. if you type -1 the program exits) 5.) Create and display a final report that should have the report name, owner and the following: Numeric output should appear as a table with the following columns: (columns should be underlined) a. Input Number b. Highest Number c. Lowest Number d. Total (by the row) e. Average Number 6.) At the end of the report you must have a grand total for the numeric entries
In: Computer Science
The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:
|
1 |
Dec. 31, 2016 |
Dec. 31, 2015 |
|
|
2 |
Assets |
||
|
3 |
Cash |
$917,690.00 |
$964,930.00 |
|
4 |
Accounts receivable (net) |
?828,620.00 |
762,860.00 |
|
5 |
Inventories |
1,267,970.00 |
1,162,780.00 |
|
6 |
Prepaid expenses |
29,050.00 |
36,010.00 |
|
7 |
Land |
315,250.00 |
480,690.00 |
|
8 |
Buildings |
1,462,990.00 |
901,470.00 |
|
9 |
Accumulated depreciation-buildings |
(409,170.00) |
(382,690.00) |
|
10 |
Equipment |
511,480.00 |
453,680.00 |
|
11 |
Accumulated depreciation-equipment |
(142,100.00) |
(159,400.00) |
|
12 |
Total assets |
$4,781,780.00 |
$4,220,330.00 |
|
13 |
Liabilities and Stockholders’ Equity |
||
|
14 |
Accounts payable (merchandise creditors) |
$923,380.00 |
$958,540.00 |
|
15 |
Bonds payable |
269,000.00 |
0.00 |
|
16 |
Common stock, $25 par |
323,000.00 |
118,000.00 |
|
17 |
Paid-in capital: Excess of issue price over par—common stock |
771,200.00 |
558,000.00 |
|
18 |
Retained earnings |
2,495,200.00 |
2,585,790.00 |
|
19 |
Total liabilities and stockholders’ equity |
$4,781,780.00 |
$4,220,330.00 |
The noncurrent asset, noncurrent liability, and stockholders’ equity accounts for 2016 are as follows:
ACCOUNT Land
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 480,690 | |||
| Apr. | 20 | Realized $153,400 cash from sale | 165,440 | 315,250 |
ACCOUNT Buildings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 901,470 | |||
| Apr. | 20 | Acquired for cash | 561,520 | 1,462,990 |
ACCOUNT Accumulated Depreciation––Buildings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 382,690 | |||
| Dec. | 31 | Depreciation for year | 26,480 | 409,170 |
ACCOUNT Equipment
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 453,680 | |||
| 26 | Discarded, no salvage | 46,270 | 407,410 | |||
| Aug. | 11 | Purchased for cash | 104,070 | 511,480 |
ACCOUNT Accumulated Depreciation ––Equipment
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 159,400 | |||
| 26 | Equipment discarded | 46,270 | 113,130 | |||
| Dec. | 31 | Depreciation for year | 28,970 | 142,100 |
ACCOUNT Bonds Payable
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| May | 1 | Issued 20-year bonds | 269,000 | 269,000 |
ACCOUNT Common Stock $25 par
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 118,000 | |||
| Dec. | 7 | Issued 8,200 shares of common stock for $51 per share | 205,000 | 323,000 |
ACCOUNT Paid-In Capital in Excess of Par––Common Stock
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 558,000 | |||
| Dec. | 7 | Issued 8,200 shares of common stock for $51 per share | 213,200 | 771,200 |
ACCOUNT Retained Earnings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 2,585,790 | |||
| Dec. | 31 | Net loss | 58,980 | 2,526,810 | ||
| 31 | Cash dividends | 31,610 | 2,495,200 |
Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.
Labels and Amount Descriptions
| Labels and Amount Descriptions | |
|---|---|
| Cash paid for acquisition of building | |
| Cash paid for dividends | |
| Cash paid for merchandise | |
| Cash paid for purchase of equipment | |
| Cash received from customers | |
| Cash received from issuance of bonds payable | |
| Cash received from issuance of common stock | |
| Cash received from land sold | |
| December 31, 2016 | |
| Decrease in accounts payable | |
| Decrease in accounts receivable | |
| Decrease in cash | |
| Decrease in inventories | |
| Decrease in prepaid expenses | |
| Decrease in salaries payable | |
| Depreciation | |
| For the Year Ended December 31, 2016 | |
| Gain on sale of investments | |
| Gain on sale of land | |
| Increase in accounts payable | |
| Increase in accounts receivable | |
| Increase in cash | |
| Increase in inventories | |
| Increase in prepaid expenses | |
| Increase in salaries payable | |
| Issuance of common stock for acquisition of building | |
| Issuance of common stock for purchase of equipment | |
| Issuance of common stock to retire bonds | |
| Loss on sale of investments | |
| Loss on sale of land | |
| Net cash flow from financing activities | |
| Net cash flow from investing activities | |
| Net cash flow from operating activities | |
| Net cash flow used for financing activities | |
| Net cash flow used for investing activities | |
| Net cash flow used for operating activities | |
| Net income | |
| Net loss |
Statement of Cash Flows
Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.
|
Whitman Co. |
|
Statement of Cash Flows |
|
1 |
Cash flows from operating activities: |
|||
|
2 |
||||
|
3 |
Adjustments to reconcile net loss to net cash flow from operating activities: |
|||
|
4 |
||||
|
5 |
||||
|
6 |
Changes in current operating assets and liabilities: |
|||
|
7 |
||||
|
8 |
||||
|
9 |
||||
|
10 |
||||
|
11 |
||||
|
12 |
||||
|
13 |
Cash flows from investing activities: |
|||
|
14 |
||||
|
15 |
||||
|
16 |
||||
|
17 |
||||
|
18 |
||||
|
19 |
Cash flows from financing activities: |
|||
|
20 |
||||
|
21 |
||||
|
22 |
||||
|
23 |
||||
|
24 |
||||
|
25 |
Cash at the beginning of the year |
|||
|
26 |
Cash at the end of the year |
In: Accounting
The comparative balance sheet of Whitman Co. at December 31, 2016 and 2015, is as follows:
|
1 |
Dec. 31, 2016 |
Dec. 31, 2015 |
|
|
2 |
Assets |
||
|
3 |
Cash |
$918,260.00 |
$965,110.00 |
|
4 |
Accounts receivable (net) |
828,050.00 |
761,830.00 |
|
5 |
Inventories |
1,268,550.00 |
1,163,510.00 |
|
6 |
Prepaid expenses |
28,760.00 |
35,720.00 |
|
7 |
Land |
315,810.00 |
479,900.00 |
|
8 |
Buildings |
1,463,300.00 |
900,740.00 |
|
9 |
Accumulated depreciation-buildings |
(408,350.00) |
(381,910.00) |
|
10 |
Equipment |
512,470.00 |
454,060.00 |
|
11 |
Accumulated depreciation-equipment |
(142,270.00) |
(159,730.00) |
|
12 |
Total assets |
$4,784,580.00 |
$4,219,230.00 |
|
13 |
Liabilities and Stockholders’ Equity |
||
|
14 |
Accounts payable (merchandise creditors) |
$922,360.00 |
$957,810.00 |
|
15 |
Bonds payable |
270,000.00 |
0.00 |
|
16 |
Common stock, $25 par |
316,000.00 |
116,000.00 |
|
17 |
Paid-in capital: Excess of issue price over par—common stock |
775,000.00 |
559,000.00 |
|
18 |
Retained earnings |
2,501,220.00 |
2,586,420.00 |
|
19 |
Total liabilities and stockholders’ equity |
$4,784,580.00 |
$4,219,230.00 |
The noncurrent asset, noncurrent liability, and stockholders’ equity accounts for 2016 are as follows:
ACCOUNT Land
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 479,900 | |||
| Apr. | 20 | Realized $152,430 cash from sale | 164,090 | 315,810 |
ACCOUNT Buildings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 900,740 | |||
| Apr. | 20 | Acquired for cash | 562,560 | 1,463,300 |
ACCOUNT Accumulated Depreciation––Buildings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 381,910 | |||
| Dec. | 31 | Depreciation for year | 26,440 | 408,350 |
ACCOUNT Equipment
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 454,060 | |||
| 26 | Discarded, no salvage | 47,260 | 406,800 | |||
| Aug. | 11 | Purchased for cash | 105,670 | 512,470 |
ACCOUNT Accumulated Depreciation ––Equipment
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 159,730 | |||
| 26 | Equipment discarded | 47,260 | 112,470 | |||
| Dec. | 31 | Depreciation for year | 29,800 | 142,270 |
ACCOUNT Bonds Payable
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| May | 1 | Issued 20-year bonds | 270,000 | 270,000 |
ACCOUNT Common Stock $25 par
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 116,000 | |||
| Dec. | 7 | Issued 8,000 shares of common stock for $52 per share | 200,000 | 316,000 |
ACCOUNT Paid-In Capital in Excess of Par––Common Stock
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 559,000 | |||
| Dec. | 7 | Issued 8,000 shares of common stock for $52 per share | 216,000 | 775,000 |
ACCOUNT Retained Earnings
| ACCOUNT NO. | ||||||
| Balance | ||||||
| Date | Item | Debit | Credit | Debit | Credit | |
| 2016 | ||||||
| Jan. | 1 | Balance | 2,586,420 | |||
| Dec. | 31 | Net loss | 53,460 | 2,532,960 | ||
| 31 | Cash dividends | 31,740 | 2,501,220 |
Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.
Labels and Amount Descriptions
| Labels and Amount Descriptions | |
|---|---|
| Cash paid for acquisition of building | |
| Cash paid for dividends | |
| Cash paid for merchandise | |
| Cash paid for purchase of equipment | |
| Cash received from customers | |
| Cash received from issuance of bonds payable | |
| Cash received from issuance of common stock | |
| Cash received from land sold | |
| December 31, 2016 | |
| Decrease in accounts payable | |
| Decrease in accounts receivable | |
| Decrease in cash | |
| Decrease in inventories | |
| Decrease in prepaid expenses | |
| Decrease in salaries payable | |
| Depreciation | |
| For the Year Ended December 31, 2016 | |
| Gain on sale of investments | |
| Gain on sale of land | |
| Increase in accounts payable | |
| Increase in accounts receivable | |
| Increase in cash | |
| Increase in inventories | |
| Increase in prepaid expenses | |
| Increase in salaries payable | |
| Issuance of common stock for acquisition of building | |
| Issuance of common stock for purchase of equipment | |
| Issuance of common stock to retire bonds | |
| Loss on sale of investments | |
| Loss on sale of land | |
| Net cash flow from financing activities | |
| Net cash flow from investing activities | |
| Net cash flow from operating activities | |
| Net cash flow used for financing activities | |
| Net cash flow used for investing activities | |
| Net cash flow used for operating activities | |
| Net income | |
| Net loss |
Statement of Cash Flows
Prepare a statement of cash flows, using the indirect method of presenting cash flows from operating activities. Refer to the Labels and Amount Descriptions list provided for the exact wording of the answer choices for text entries. Be sure to complete the heading of the statement. In the operating activities section, use the minus sign to indicate cash outflows, decreases in cash and a net cash outflow, if required. In the investing and financing activities section, use a minus sign only to indicate a NET cash outflow for the section.
|
Whitman Co. |
|
Statement of Cash Flows |
|
1 |
Cash flows from operating activities: |
|||
|
2 |
||||
|
3 |
Adjustments to reconcile net loss to net cash flow from operating activities: |
|||
|
4 |
||||
|
5 |
||||
|
6 |
Changes in current operating assets and liabilities: |
|||
|
7 |
||||
|
8 |
||||
|
9 |
||||
|
10 |
||||
|
11 |
||||
|
12 |
||||
|
13 |
Cash flows from investing activities: |
|||
|
14 |
||||
|
15 |
||||
|
16 |
||||
|
17 |
||||
|
18 |
||||
|
19 |
Cash flows from financing activities: |
|||
|
20 |
||||
|
21 |
||||
|
22 |
||||
|
23 |
||||
|
24 |
||||
|
25 |
Cash at the beginning of the year |
|||
|
26 |
Cash at the end of the year |
In: Accounting
Consider the following relational schema:
Salerep(sales_rep_ID, name, address, commission, rate)
Customer(customer_number, name, address, balance, credit_limit, sales_rep_ID)
Part(part_number, part_description, on_hand, class, warehouse, price)
Orders(order_number, order_date, customer_number)
Orderlilne(order_number, part_number, number_order)
Write SQL statements for the following queries:
a) Produce a list showing part_number, part_description, on_hand, and price sorted by part_description.
b) List customer’s name followed by order_number, part_description, and number_order.
c) List names of customers who have ordered the most expensive item(Hint: Use a nested SQL query to determine thehighest price.)
d) List the names of the sale_reps who have sold the most number of part “123”.(Hint: Use a nested SQL query for the FROM clause)
In: Computer Science
Read the article that you will find entitled “The experience of nurses working with nursing students in a hospital: a phenomenological investigation.” Give a brief summary about the research study. Select one of the mid-range nursing theorists that can be used as the theoretical framework of the study and justify your answer. You must include at least two paragraphs in your analysis.
Objective:
This article explores the experiences of nurses working with
Spanish nursing students in a hospital.
Methods:
a qualitative phenomenological approach and a convenience sample
were used. Twenty-two nurses belonging to a public hospital in
Spain were included in the study. The data were collected through
unstructured and semi-structured interviews, and analyzed using
Giorgi's proposal. The Consolidated Criteria for Qualitative
Research Reports were followed.
Results:
Three main themes describe the experience of nurses: "The
relationship of the nurse with the nursing students" Most nurses
emphasize the importance of the first contact with the students and
consider that the attitude of the students is essential. "The
definition of the role of the student in clinical practice"; it is
necessary to unify the role and interventions of the nurse to avoid
misguiding the students and to establish priorities in clinical
practice. "Build bridges between clinical environments and the
University"; the need to establish common ground and connections
between the university and the hospital's clinical services was
emphasized. Nurses think that the educational program should also
be designed by the clinical services.
Conclusions:
Understanding the meanings of female nursing students with nurses
can provide a deeper insight into their expectations.
Descriptors: Nursing Education; Hospitals; Students in Nursing;
Qualitative research
In: Nursing
For this programming assignment, you will use your previous code that implemented a video game class and objects with constructors. Add error checking to all your constructors, except the default constructor which does not require it. Make sure that the high score and number of times played is zero or greater (no negative values permitted). Also modify your set methods to do the same error checking. Finally add error checking to any input requested from the user.
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class VideoGame {
private:
string name;
int highScore;
int numOfPlays;
public:
VideoGame() {
name = "NA";
highScore = 0;
numOfPlays = 0;
}
VideoGame(string n, int score, int num) {
name = n;
highScore = score;
numOfPlays = num;
}
VideoGame(string n) {
name = n;
highScore = 0;
numOfPlays = 0;
}
VideoGame(const VideoGame &p2)
{
name = p2.name;
highScore = p2.highScore;
numOfPlays = p2.numOfPlays;
}
void setName(string n) {
name = n;
}
void setHighScore(int score) {
highScore = score;
}
void setNumOfPlays(int num) {
numOfPlays = num;
}
string getName() {
return name;
}
int getHighScore() {
return highScore;
}
int getNumOfPlays() {
return numOfPlays;
}
};
string inputName() {
string n;
cout << "Enter name of video game: ";
getline(cin >> ws, n);
return n;
}
int inputHighScore() {
int score;
cout << "Enter current high score of game: ";
cin >> score;
return score;
}
int inputNumOfPlays() {
int num;
cout << "Enter number of times game is played: ";
cin >> num;
return num;
}
void output(VideoGame game) {
cout << game.getName() << endl
<< "Played " << game.getNumOfPlays() << " times (HIGH SCORE " << game.getHighScore() << ")" << endl;
}
int main() {
VideoGame game1, game2, game3("VideoGame 3");
game1.setName(inputName());
game1.setHighScore(inputHighScore());
game1.setNumOfPlays(inputNumOfPlays());
cout << "\nGame1" << endl;
output(game1);
cout << endl;
game2.setName(inputName());
game2.setHighScore(inputHighScore());
game2.setNumOfPlays(inputNumOfPlays());
cout << "\nGame2" << endl;
output(game2);
cout << "\nGame3" << endl;
output(game3);
VideoGame game4 = game2;
cout << "\nGame4" << endl;
output(game4);
return 0;
}
In: Computer Science
Create a C++ program to simulate an art gallery:
Title of painting
Artists first name
Artists last name
Address street number
Address street name
Address city
Address state
Address zip
Artists website
Category
Number
Should print to a file all of the paintings by category and in alphabetical order based on the artist's last name.
This is an example txt file but the program will be tested with multiple files with different numbers of paintings:
Full Fathom Five
Jackson
Pollock
16
Woodbury
Springs
NY
11937
www.jacksonpollock.com
Abstract
978-3-16-148410-0
Impression, Sunrise
Claude
Monet
361
Sunflower
Giverny
France
27620
www.claudemonet.com
Impressionism
968-3-16-158420-0
A Sunday Afternoon on the Island of La Grande Jatte
Georges
Seurat
89
Longview
Paris
France
75006
www.gseurat.com
Pointillism
918-3-15-152420-0
In: Computer Science