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
Nataliya [291]
2 years ago
6

Given main(), complete the Car class (in files Car.h and Car.cpp) with member functions to set and get the purchase price of a c

ar (SetPurchasePrice(), GetPurchasePrice()), and to output the car's information (PrintInfo()). Ex: If the input is: 2011 18000 2018 where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, the output is: Car's information: Model year: 2011 Purchase price: 18000 Current value: 5770
Computers and Technology
1 answer:
Snezhnost [94]2 years ago
6 0

The C++ program to show and complete the Car class (in files Car.h and Car.cpp) with member functions to set and get the purchase price of a car is:

<h3>Car.h</h3>

#ifndef CARH

#define CARH

class Car{

private:

int modelYear;

 

int purchasePrice;

int currentValue;

public:

void SetModelYear(int userYear);

int GetModelYear() const;

void SetPurchasePrice(int purchasePrice);

int GetPurchasePrice() const;

void CalcCurrentValue(int currentYear);

void PrintInfo();

};

#endif // CARH

<h3>Car.cpp</h3>

#include<iostream>

#include<math.h>

#include "Car.h"

using namespace std;

void Car::SetModelYear(int userYear){

modelYear=userYear;

}

int Car::GetModelYear() const{

return modelYear;

}

void Car::SetPurchasePrice(int userPrice){

purchasePrice = userPrice;

}

int Car::GetPurchasePrice() const{

return purchasePrice;

}

void Car::CalcCurrentValue(int currentYear){

double depreciationRate = 0.15;

int carAge = currentYear- modelYear;

currentValue = (int)round(purchasePrice*pow((1-depreciationRate),carAge));

}

void Car::PrintInfo(){

cout<<"Car's information:\n";

cout<<"\t\tModel Year : "<<GetModelYear();

cout<<"\n\t\tPurchase price: "<<GetPurchasePrice();

cout<<"\n\t\tCurrentValue: "<<currentValue;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

You might be interested in
You are having trouble closing a program. You have tried to hit the Close button, the keyboard shortcut to close the program, an
vladimir2022 [97]

Answer:

You can open the version of your computer or device from the task manager to see the running programs and close the application

Explanation:

Right-click on the Windows Start menu and choose Task Manager (another way to open it is to press the keyboard shortcut Ctrl + Alt + Delete and select it from the options that appear).

NOTE: Click here if you don't know how to display Windows 8 Start.

You will see the main Administrator window (as in the image above). Displays a list of the programs that are currently running.

Find the application or process you want to close. Click on it with the RIGHT button and choose End task. In some cases a notice appears asking you to confirm it. Read what it says to know the consequences of forcing it. Confirm if you are determined to do so.

IMPORTANT:

There are viruses, adware or other spam programs that you may not be able to close even in this way. For these cases follow this link on how to clean viruses without entering Windows.

When you're done you can exit the Task Manager window. Click here to close background applications.

Estos pasos sirven para forzar que se cierren programas que no responden en Windows 10, 8 u 8.1. Enlazan además a instrucciones para cerrar programas o aplicaciones

4 0
3 years ago
In a block of addresses we know the IP address of one host is Roll no. Roll no. Roll no. Roll no./20.What is the first address a
lesya [120]

Answer:

If there’s one topic that trips people up (both new and experienced) in the networking industry, it is that of Subnetting.

One of the reasons this happens is that one has to perform (mental) calculations in decimal and also binary. Another reason is that many people have not had enough practice with subnetting.

In this article, we will discuss what Subnetting is, why it came about, its usefulness, and how to do subnetting the proper way. To make this article as practical as possible, we will go through many examples.

Note: While subnetting applies to both IPv4 and IPv6, this article will only focus on IPv4. The same concepts explained here can be applied to IPv6. Moreover, subnetting in IPv6 is more of a want rather than a necessity because of the large address space.

IP address network

For example, any traffic with a destination IP address of 192.168.1.101 will be delivered to PC1, while traffic addressed to 192.168.1.250 will be delivered to SERVER.

Note: This is an oversimplification of things just for understanding sake and refers to Unicast (one-to-one) IPv4 addresses. Traffic sent to Multicast (one-to-many) and Broadcast (one-to-all) IP addresses can be delivered to multiple devices. Also, features like Network Address Translation (NAT) allow one IP address to be shared by multiple devices.

To help your understanding of IP addresses and subnetting, you need to resolve the following fact in your head: Computers think in binary, that is, 0s and 1s. Therefore, even though we see an IP address represented like 192.168.1.250, it is actually just a string of bits – 32 bits in total for IPv4 addresses.

To make them more readable for humans, IPv4 addresses are represented in dotted decimal notation where the 32 bits are divided into 4 blocks of 8 bits (also known as an octet), and each block is converted to a decimal number.

For example, 01110100 in binary is 116 in decimal:

A unicast IPv4 address such as 192.168.1.250 can be divided into two parts: Network portion and Host ID. So what does this mean? Well, IPv4 addresses were originally designed based on classes: Class A to Class E. Multicast addresses are assigned from the Class D range while Class E is reserved for experimental use, leaving us with Class A to C:

Class A: Uses the first 8 bits for the Network portion leaving 24 bits for host IDs. The leftmost bit is set to “0”.

Class B: Uses the first 16 bits for the Network portion leaving 16 bits for host IDs. The two leftmost bits are set to “10”.

Class C: Uses the first 24 bits for the Network portion leaving 8 bits for host IDs. The three leftmost bits are set to “110”.

Note: The range of Class A is actually 1-126 because 0.x.x.x and 127.x.x.x are reserved.

With these classes, a computer/device can look at the first three bits of any IP address and determine what class it belongs to. For example, the 192.168.1.250 IP address clearly falls into the Class C range.

Looking at the Host ID portion of the classes, we can determine how many hosts (or number of individual IP addresses) a network in each class will support. For example, a Class C network will ideally support up to 256 host IDs i.e. from 00000000 (decimal 0) to 11111111 (decimal 255). However, two of these addresses cannot be assigned to hosts because the first (all 0s) represents the network address while the last (all 1s) represents the broadcast address. This leaves us with 254 host IDs. A simple formula to calculate the number of hosts supported

Explanation: Final answer is Start address: 192.168.58.0 + 1 = 192.168.58.1

End address: 192.168.58.16 – 2 = 192.168.58.14

Broadcast address: 192.168.58.16 – 1 = 192.168.58.15

7 0
2 years ago
Compose an e-mail to your coworker Adam that describes how to add a photograph to a slide.
pantera1 [17]

The ways to add a photograph to a slide is given below: What to write when composing the email is also given below.

<h3>How do you Insert photos into a slide?</h3>

The steps are given below?\

  • The first thing to do is to open  the slide you want to insert the image on.
  • then click on Insert menu, and take the cursor to the Picture, and then one can click Photo Browser or insert pictures.
  • Then select the picture that you want and and one can drag it onto the slide.

Note that it is essential to follow the steps and one can add as many pictures as they want to their slides.

Learn more about e-mail from

brainly.com/question/24506250

#SPJ1

3 0
2 years ago
Which pdu is processed when a host computer is de-encapsulating a message at the transport layer of the tcp/ip model?.
yulyashka [42]

The PDU that is processed when a host computer is de-encapsulating a message at the transport layer of the tcp/ip model is segment.

<h3>What is this PDU about?</h3>

Note that in the transport layer, a host computer is said to often de-encapsulate  what we call a segment so that they can be able to put back data to an acceptable or given format through the use of the application layer protocol that belongs to the TCP/IP model.

Therefore, The PDU that is processed when a host computer is de-encapsulating a message at the transport layer of the tcp/ip model is segment as it is the right thing to do.

Learn more about host computer from

brainly.com/question/553980

5 0
2 years ago
To remove the field list when working on a report in Design view, tap or click the ____ button on the REPORT DESIGN TOOLS DESIGN
Rudiy27

Answer:

The correct answer to the following question will be "Remove".

Explanation:

A report consists of information taken from tables or queries and information stored in the design of the report such as names, heading, and graphics. Also known as the source of the report are tables or queries that provide the underlying data.

The majority of reporting tools provide only a standard report layout where the report developer may not construct a custom layout with elements positioned in certain areas.

And, If we want to remove any field while working in Design view on a report then we have to click on the remove button for such tasks,

Therefore, the Remove button is the correct answer.

6 0
3 years ago
Other questions:
  • To include totals and other statistics at the bottom of a datasheet, click the ____ button on the HOME tab to include the Total
    12·1 answer
  • Which finger types the return or enter key?
    6·2 answers
  • How can an Excel table be added to a Word document? Check all that apply.
    15·1 answer
  • How many positions there are in the media and design department?
    14·2 answers
  • How many transponders are contained within a typical satellite?
    12·1 answer
  • You would like to put the data in order by product number. What should you do?
    15·1 answer
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
  • What are your considerations in making a derivative ict content ti effectively communicate or present data or information?
    11·1 answer
  • The WordPress Widgets submenu is located where on the WordPress site?
    5·1 answer
  • 9- Write a program in MARIE to add three numbers.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!