I am having trouble with the bool function in this code.

I am having trouble with the bool function in this code. Can anyone help me figure out how to write it. I need a

yes or no answer and then I need to either return the regular price or a discounted price. So if the answer is yes, then I need to return the original price * .25 and if no I need to return the original price.

My code is below:

.h file:

class Computer

{

private:

string edition;

string brand;

int sizeHardDrive;

double price;

bool refurbishedComputer;

public:

Computer(string edt, string brd, int size, double prc, bool refurb);

Computer();

string getEdition();

string getBrand();

int getSizeHardDrive();

double getPrice();

void setEdition(string edt);

void setBrand(string brd);

void setSizeHardDrive(int size);

void setPrice(double prc);

bool refurbishedComputer;

double calcDiscount();

void printInfo();

~Computer();

};

function.ccp file

#include “Computer.h”

#include <string>

#include <iomanip>

#include <iostream>

using namespace std;

Computer::Computer()

{

edition = “unknown”;

brand = “unknown”;

sizeHardDrive = 0;

price = 0;

refurbishedComputer = true;

}

Computer::Computer(string edt, string brd, int size, double prc, bool refurb)

{

this->edition = edt;

this->brand = brd;

this->sizeHardDrive = size;

this->price = prc;

this->refurbishedComputer = refurb;

}

Computer::~Computer() {

}

string Computer::getEdition()

{

return edition;

}

string Computer::getBrand()

{

return brand;

}

int Computer::getSizeHardDrive()

{

return sizeHardDrive;

}

double Computer::getPrice()

{

return price;

}

void Computer::setEdition(string edt)

{

this->edition = edt;

}

void Computer::setBrand(string brd)

{

this->brand = brd;

}

void Computer::setSizeHardDrive(int size)

{

this->sizeHardDrive = size;

}

void Computer::setPrice(double prc)

{

this->price = prc;

}

void refurbishedComputer(bool refurb)

{

return refurb;

}

double Computer::calcDiscount()

{

return{ (prc * .25) – prc };

}

void printInfo()

{

cout << “Computer Edition: ” << endl;

cout << “Computer Brand: ” << endl;

cout << “Size of Hard Drive: ” << endl;

cout << “Computer Price ” << endl;

cout << “Refurbished? (y/n) ” << refurbishedComputer << endl;

cout << fixed << setprecision(2);

}

Main.ccp file

#include “Computer.h”

#include <string>

#include <iomanip>

#include <iostream>

#include <fstream>

#include <cstdlib>

using namespace std;

int main()

// declare object with default constructor

{

Computer chromebook1;

chromebook1.setEdition(“First”);

chromebook1.setBrand(“Google”);

chromebook1.setSizeHardDrive(562);

chromebook1.setPrice(399.99);

chromebook1.setrefurbishedComputer(bool refurb)

cout << “Edition: ” << chromebook1.getEdition() << endl;

cout << “Brand: ” << chromebook1.getBrand() << endl;

cout << “Size of Hard Drive” << chromebook1.getSizeHardDrive() << endl;

cout << “Price: ” << chromebook1.getPrice() << endl;

cout << “Discounted Price: ” << chromebook1.refurbishedComputer << endl;

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Question 3 3 pts (TCO 4, 5, 8) When arranging actors and objects on a sequence diagram, it is nice to arrange them _____.

Question 3 3 pts

(TCO 4, 5, 8) When arranging actors and objects on a sequence diagram, it is nice to

arrange them _____.

in alphabetical order down the side of the diagram

in alphabetical order across the top of the diagram

in the order in which they participate in the sequence down the side of the diagram

in the order in which they participate in the sequence across the top of the diagram

 

Flag this Question Question 4 3 pts

(TCO 4, 5, 8) Which of the following objects is most likely to be destroyed at some point in time in a sequence diagram?

Customer

Order

Item

Invoice

 

Flag this Question Question 5 3 pts

(TCO 4, 5, 8) When an object sends a message to itself in a sequence diagram, it is referred to as _____.

recursive messaging

self-messaging

self-delegation

recursive delegation

 

Flag this Question Question 6 3 pts

(TCO 4, 5, 8) The first step in building a sequence diagram is to _____.

analyze the use case

identify which objects will participate

set the lifeline for each object

add the focus of control to each object’s lifeline

 

Flag this Question Question 7 3 pts

(TCO 4, 5, 8) An execution occurrence in a sequence diagram is represented by a(n) _____.

thin rectangular box over the lifeline

lifeline

message

actor

 

Flag this Question Question 8 3 pts

(TCO 4, 5, 8) The changing of values for an object through a system is represented by the _____.

communication diagram

object diagram

use case diagram

None of these

 

Flag this Question Question 9 3 pts

(TCO 4, 5, 8) Which of the following are valid event types?

call event

signal event

change event

All of these

 

Flag this Question Question 10 3 pts

(TCO 4, 5, 8) The life of a lifeline is indicated by its _____ on the sequence diagram.

vertical position

horizontal position

vertical length

width

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

What is NOT part of the Association syntax?

What is NOT part of the Association syntax?

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

(CO 1) Python is considered a good first language to learn because:

Question 1

4 pts

(CO 1) Python is considered a good first language

to learn because:

Group of answer choices

it has a simple syntax

it has most of the features of traditional programming languages

it is open source

all of the above

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"