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
Mekhanik [1.2K]
3 years ago
8

(1) Create three files to submit:

Computers and Technology
1 answer:
Sindrei [870]3 years ago
6 0

Answer:

We have the files and codes below with appropriate comments

Explanation:

ItemToPurchase.h:

#pragma once

#ifndef ITEMTOPURCHASE_H_INCLUDED

#define ITEMTOPURCHASE_H_INCLUDED

#include<string>

#include <iostream>

using namespace std;

class ItemToPurchase

{

public:

    //Declaration of default constructor

    ItemToPurchase();

    //Declaration of SetName function

    void SetName(string ItemName);

    //Declaration of SetPrice function

    void SetPrice(int itemPrice);

    //Declaration of SetQuantity function

    void SetQuantity(int itemQuantity);

    //Declaration of GetName function

    string GetName();

    //Declaration of GetPrice function

    int GetPrice();

    //Declaration of GetQuantity function

    int GetQuantity();

private:

    //Declaration of itemName as

    //type of string

    string itemName;

    //Declaration of itemPrice as

    //type of integer

    int itemPrice;

    //Declaration of itemQuantity as

    //type of integer

    int itemQuantity;

};

#endif

ItemToPurchase.cpp:

#include <iostream>

#include <string>

#include "ItemToPurchase.h"

using namespace std;

//Implementation of default constructor

ItemToPurchase::ItemToPurchase()

{

    itemName = "none";

    itemPrice = 0;

    itemQuantity = 0;

}

//Implementation of SetName function

void ItemToPurchase::SetName(string name)

{

    itemName = name;

}

//Implementation of SetPrice function

void ItemToPurchase::SetPrice(int itemPrice)

{

    this->itemPrice = itemPrice;

}

//Implementation of SetQuantity function

void ItemToPurchase::SetQuantity(int itemQuantity)

{

    this->itemQuantity = itemQuantity;

}

//Implementation of GetName function

string ItemToPurchase::GetName()

{

    return itemName;

}

//Implementation of GetPrice function

int ItemToPurchase::GetPrice()

{

    return itemPrice;

}

//Implementation of GetQuantity function

int ItemToPurchase::GetQuantity()

{

    return itemQuantity;

}

main.cpp:

#include<iostream>

#include<string>

#include "ItemToPurchase.h"

using namespace std;

int main()

{

    //Declaration of ItemToPurchase class objects

    ItemToPurchase item1Cart, item2Cart;

    string itemName;

    //create a variable names like itemPrice

    //itemQuantity,totalCost as type of integer

    int itemPrice;

    int itemQuantity;

    int totalCost = 0;

    //Display statement for Item1

    cout << "Item 1:" << endl;

    cout << "Enter the item name : " << endl;

    //call the getline function

    getline(cin, itemName);

    //Display statememt

    cout << "Enter the item price : " << endl;

    cin >> itemPrice;

    cout << "Enter the item quantity : " << endl;

    cin >> itemQuantity;

    item1Cart.SetName(itemName);

    item1Cart.SetPrice(itemPrice);

    item1Cart.SetQuantity(itemQuantity);

    //call cin.ignore() function

    cin.ignore();

    //Display statement for Item 2

    cout << endl;

    cout << "Item 2:" << endl;

    cout << "Enter the item name : " << endl;

    getline(cin, itemName);

    cout << "Enter the item price : " << endl;

    cin >> itemPrice;

    cout << "Enter the item quantity : " << endl;

    cin >> itemQuantity;

    item2Cart.SetName(itemName);

    item2Cart.SetPrice(itemPrice);

    item2Cart.SetQuantity(itemQuantity);

    //Display statement

    cout << "TOTAL COST : " << endl;

    cout << item1Cart.GetName() << " " << item1Cart.GetQuantity() << " @ $" << item1Cart.GetPrice() << " = " << (item1Cart.GetQuantity()*item1Cart.GetPrice()) << endl;

    cout << item2Cart.GetName() << " " << item2Cart.GetQuantity() << " @ $" << item2Cart.GetPrice() << " = " << (item2Cart.GetQuantity()*item2Cart.GetPrice()) << endl;

    totalCost = (item1Cart.GetQuantity()*item1Cart.GetPrice()) + (item2Cart.GetQuantity()*item2Cart.GetPrice());

    cout << endl;

    cout << "Total : $" << totalCost << endl;

    return 0;

}

You might be interested in
Which command is used to copy entire folder structures between volumes or across a network while maintaining all NTFS file permi
True [87]

Answer:

Robocopy

Explanation:

The newer and most used command to accomplish this is Robocopy. This code does exactly what is described in the question, it copies the entire structure of the volume in question but still maintains all of its permissions and attributes. It also allows you to copy large datasets at an extremely fast speed, roughly 150 MB/sec. Robocopy can even resume interrupted file transfers without loss of data.

8 0
3 years ago
How to use access?<br> like working in access and bringing tables and stuff
zheka24 [161]

I would recommend first familiarizing yourself with the program Access by watching introductions.

If you have even more time to spare and want hands-on experience, use Wise Owl exercises. Search up college classes assignments or guides. (Boy, do they love their big workbooks.) Essentially, do practice exercises.

5 0
2 years ago
Choose the word that best completes this sentence. ____________ should cover every part of the worksite.
Evgen [1.6K]
Since you provide no choices, here are several things that should cover every part of the worksite :
- Emergency exit
- Safety measures

Hope this helps
5 0
3 years ago
Read 2 more answers
if the wide area network (wan) is supporting converged applications like voice over internet protocol (voip), which of the follo
Dominik [7]

if the wide area network (wan) is supporting converged applications like voice over internet protocol (voip) internet protocol (ip) routing lookups will be even more essential to the assurance of the network.

Understanding WAN

WAN stands for Wide Area Network is a network that is used as a network that connects between local networks.  Local computer networks are not only physically adjacent to each other, but share the same group of IP addresses.  

The local network can be one room, one office or even one city.  While the WAN itself is a network that connects these local networks within a city, province or even between countries.  The difference between WAN and LAN networks is in the type of media used.  Generally local networks or LANs use similar network media.

While the WAN is connected to devices with different transmission media and protocols.  The WAN coverage area is also very wide, but unites the network as if it were in one room.  WAN networks have lower data transfer rates than local networks or LANs. WAN network technology relies on companies providing long-distance telecommunications services.  WAN networks use many kinds of network technologies with a mix of analog and digital signals for data transmission.  Of course this is different from a local network or LAN which uses a connection between computers that are physically connected to each other with the same protocol and transmission media.  The components in the WAN and their functions will be discussed later.

Learn more about WAN at brainly.com/question/14793460.

#SPJ4.

4 0
1 year ago
What mobile operating system below requires all applications to be reviewed and approved before they can be made available in th
FinnZ [79.3K]

Answer:

The correct answer to the following answer will be iOS.

Explanation:

The iOS formerly stands for iPhone Operating System, basically is a mobile operating system developed by Apple Inc. This edition mainly supports Apple devices such as iPhone, iPod touch, iPad, etc.

Just because of this iOS gives the improvement to the entire application and is one of the operating systems which requires all that applications to be approved before showing availability in the App stores.

So, iOS is the right answer.

4 0
3 years ago
Other questions:
  • Help asap. 10 points.
    8·2 answers
  • Which statement describes the word "iterative"?
    9·1 answer
  • Which skill refers to the ability to visualize and implement possible business solutions to problems?
    6·1 answer
  • What is the first thing you should do when troubleshooting a computer problem
    5·2 answers
  • Which search engine do you prefer? Why
    15·2 answers
  • What can happen if you do not follow the directions when cooking or baking? (Give 4 examples in a sentence each)
    8·1 answer
  • Similarities between inline css and internal css​
    6·1 answer
  • Add me on Fortnite. Epic is smashman892. *Ik it sux but it's an old account* Comment ur epic
    6·2 answers
  • Leon wants an output from his tablet. What should he look at?
    9·1 answer
  • Do small companies need computers? why?<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!