C++ code pls write the code

C++ Code Pls Write The Code

Answers

Answer 1

Answer:

Following are the code to this question:

#include<iostream>//defining header file

using namespace std;

class vec//defining class vec  

{

int x, y, z; //defining integer varaible x, y, z

public: // using public access specifier

vec() //defining default constructor

{

   x = 0; //assign value 0 in x variable  

   y = 0; //assign value 0 in y variable

   z = 0;//assign value 0 in z variable

}

vec(int a, int b , int c) //defining parameterized constructor vec

{

   x = a; //assign value a in x variable

   y = b; //assign value b in y variable

   z = c;//assign value c in z variable

}

void printVec() //defining a method printVec

{

   cout<<x<<","<<y<<","<<z<<endl; //use print method to print integer variable value

}

//code

vec& operator=(const vec& ob) //defining operator method that create object "ob" in parameter  

{

x=ob.x; //use ob to hold x variable value

y=ob.y;//use ob to hold y variable value

z=ob.z;//use ob to hold z variable value

return *this;//using this keyword to return value  

}

};

int main()//defining main method

{

vec v(1,2,3);//calling parameterized constructor

vec v2; //creating class object to call method

v2=v; //creatring reference of object

v2.printVec(); //call method printVec

return 0;

}

Output:

1, 2, 3

Explanation:

In the above-given code part, a method "operator" is defined, that accepts an object or we can say that it is a reference of the class "ob", which is a constant type. Inside the method, the object is used to store the integer variable value in its variable and use the return keyword with this point keyword to return its value.    


Related Questions

People convicted of cyberbullying in most states
face no punishment for their actions.
face varying degrees of punishment.
are taught how to use technology positively.
are forced to do community service.

Answers

Answer: The Answer is B. face varying degrees of punishment.

Hope this helps! ^^ (also i know this is the right answer because i got it correct)

Answer:

b

Explanation: the punishment depends on the severeness , so we dont know the exact punishment

How can you say that a computer is a versatile machine?​

Answers

Answer:

A computer is a versatile machine because is used for many purposes,a modern day computer can run multiple data at once making a fast and efficient machine very durable and effective for our use in all areas of life.

A network is:
A. A group of people or things that are individually connected to one another.
B. A number of individuals who share the same values and ideas.
C.a means of mass communication in print and other forms.
D. The main idea or information contained in a media piece.

Answers

Explanation:

The answer to this question is A

Explain what a wiki is and list its advantages.

Answers

Explanation:

Wikis are defined as a form of a website or web page or a database where the users can work on the data, they can even add or edit the data. Wikis use a very quick as well as a easy syntax that allows the users to format the text and create various links between the pages. The users need internet browsers for that.

One of the main advantage of wiki is that it provides ability to collaborate asynchronously, and also without  time constraints.Besides it also provides a beneficial function of something. It is free and not expensive.

What term is used to describe an individual's money and personal property? budget income assets finances

Answers

Answer:

Pretty sure it's assests.

Explanation:

Income - Intake of money.

Budget - How much money you can spend.

Finances - Things you need to pay ort fund.

An asset is made up of the set of quantifiable goods and properties, which are owned by a person or a company.

What is an asset?

A right that has financial value is called an asset, which is a resource with value that someone owns.

Characteristics of an asset

The assets are recorded in the accounting balances, forming the credit.

The assets will receive a monetary value each, this valuation will depend on different criteria.

Therefore, we can conclude that the asset is the set of personal property, rights and other resources owned by a person.

Learn more about an asset here: https://brainly.com/question/16983188

Which example of IT lifelong learning is most likely to lead to a promotion

Answers

Answer:

A supervisor learns about personal finance.

Hope the above answer helps u...

If my answer helped u mark me as brainlist..!

Follow me...

Answer:

A supervisor learns about personal finance.

Explanation:

HELP FAST PLEASE!!! What is a glass tube containing electrodes used as a switch to produce on or off signals for the computer? First person to answer gets branliest. :3

Answers

Answer:

The answer is... Vaccum Tubes...

This is one which was used in computers before the Phenomenal invention of Transisitors.

A glass tube containing electrodes used as a switch to produce on or off signals for the computer is a Vacuum Tube.

What is a vacuum tube?

A vacuum tube is a tube that controls the transfer of electrons inside a tub. It is a valve. It is also called an electronic device used in television, amplifiers, radios, etc.

A vacuum tube contains a cathode and anode. The cathode is heated, and it emits or releases electrons. This emission is called thermionic emission. It controls the transfer of electrons, in a high-charge device. This is applied to the device where the electric potential difference is very high.

Vacuum tubes are used in old times, they are still used in some industries.

Thus, a vacuum tube is a glass tube with electrodes that serves as a switch to generate on or off signals for the computer.

To learn more about vacuum tubes, refer to the link:

https://brainly.com/question/14992264

#SPJ2

Students who respond promptly to e-mails are following which netiquette rule?

A. keeping content appropriate
B. assessing an online environment
C. respecting everyone’s time
D. practicing ethical behaviors

Answers

Answer:

respecting everyone's time

Explanation:

they don't make people wait for a response

Its Option C - Respecting Everyone’s Time.
Thank you!

Today technology is based in Science and engineering, earlier it was based on
__________ _____-_____.

Answers

Answer:

Technical know-how

Explanation:

what are the earliest invention in human history​

Answers

Answer: Tools, Boats, Hand made bricks.

Explanation: The tools were the first technological advancement, the boats were the next, them hand made bricks for construction.

1605:newspapers
1608:telescope
1620:Compound microscope
1630:Slide rule
1642:mechanical calculator 1643:barometer
1650:vacuum pump
1656:pendulum clock

Hope this is enough

When performing actions between your computer and one that is infected with a virus, which of the following offers No risk of your computer becoming infected?
A. Printing to the same printer as infected computer
B. Accepting email attachments sent from an infected computer
C. Sharing Word documents with an infected computer
D. Sharing removable disks with an infected computer

Answers

Answer:

d

Explanation:

The correct option is D: Sharing removable disks with an infected computer

Removable disks are disks that use to keep data as well transfer data or information from one computer to another computer.

With Removable disks a computer infected with a virus cannot infect another Computer as the what the user does is to simply insert  the USB port of the  Removable disks into the computer which inturn enable the transfer of data to the computer to take place .

Learn more about Removable disks here:

https://brainly.com/question/4327670

What is true about connectionless packet switched networks? a. each datagram must contain both source and destination addresses b. without a connection, datagrams may not arrive in sequential order at the destination c. establishment of a connection between communicating points is not required prior to exchanging datagrams, thus reducing overhead communications d. all of the above are true

Answers

Answer:

d. all of the above are true

Explanation:

Connectionless Packet Switching is a term that is used in computer networking operations to describe the breaking of information exchange path into a various packet of small sizes acquired and refined over network switches and routers, which is then transferred from one subsequent node to the other. It is sometimes referred to as Datagram Networks

However, during this operation, Connectionless Packet Switching must satisfy the following amongst others:

1.  each datagram must comprise both source and destination addresses

2.   without a connection, datagrams may not come in sequential order at the destination

3.  establishment of a connection between communicating points is not needed prior to exchanging datagrams, thus reducing overhead communications

Therefore, considering the available options, the correct answer is option D

Clicking and double-clicking are two of the five

Answers

Answer:

The correct answer is events

The parameter passing mechanisn used in C is

Answers

Answer:

Hope you understand this answer

Pass by value is the answer

If you have a document that is relevant to more than one folder in your computer what should you do?

Answers

Answer:

save it to my docs

Explanation:

A coach wants to divide the basketball team into two groups for a practice game. Which statistical measurement is the coach most likely to use?
A) percentile
B) mean
C) median
D) mode

Answers

Answer:

median

Explanation:

Answer:

C) Median

Explanation:

1) You have a class called Sheep that wants to keep track of how many Sheep have ever been created. Where is a good place to put that variable? 2) When an h file mentions another class, what is that called? (When a cpp file needs to use a class, they include it. This is an h file just mentioning a class, like it has a pointer of that type. You are promising the compiler that the class is in another file.) 3) What is a good guideline for deciding you must write a copy constructor, an assignment operator, and a destructor? 4) void Rock::Func( const Rock & X){} What is that argument type called and what does it do? 5) We saw overloading the = sign. How do you declare a class wanting to override the parenthesis operator?

Answers

Answer:

The counter variable for the sheep count should be declared and initialized before the constructor in the class. The extern keyword should be used to declare the class in the receiving C source file. A constructor is defined when there is a need to instantiate an object with an argument and an assignment operator is used to initialize a variable. The const keyword is used to specify a variable whose value should not change during the course of the program execution.

Explanation:

The C programming language is an object-oriented programming language and has variable specifiers to define variable scopes in a program.

_______ tools enable people to connect and exchange ideas.
A) Affective computing.
B) Social media.
C) Debugging
D) Computer forensics.

Answers

Social media is a tool that enables people to connect and exchange ideas. Thus the correct option is B.

What is communication?

Communication is referred to the exchange of information between two individuals in the form of conversation, opinion, suggestion, or advice with the help of medium or direct interaction.

Social media is referred to as a tool of communication that enables people to share their ideas, thoughts, and opinions with a wide network of people and helps them to get information about the events happening in the world.

An internet tool for interaction, information sharing, and social networking is social media. Networking software that connects people around the world is an internet-based technology, strictly understood.

Therefore, option B is appropriate.

Learn more about Communication, here:

https://brainly.com/question/22558440

#SPJ5

Social media is a tool that enables people to connect and exchange ideas. Therefore, the correct answer is option B.

The exchange of information between two people in the form of conversation, opinion, suggestion, or advice with the use of a medium or direct interaction is referred to as communication.

Social media is referred to as a communication tool that enables individuals to communicate their thoughts, ideas, and opinions with a large network of people and assists them in learning about global events.

Social media is an online medium for communication, sharing of knowledge, and social networking. According to the definition of the term, internet-based technology includes networking software that links individuals worldwide.

Therefore, the correct answer is option B.

Learn more about communication here:

brainly.com/question/22558440

#SPJ6

A workstation’s user prefers KDE over GNOME. Which login manager can this user run to ensure direct login to KDE?
a. XDM
b. KDM
c. GDM
d. Any of the above

Answers

Answer:

B. KDM

Explanation:

The KDE display manager (KDM) was developed for the KDE desktop environment, while the GDM is a display manager for the gnome desktop environment.

The XDM display manager is used by the Linux operating system when a specific desktop environment is not chosen.

Egyptian hieroglyphs were part of a writing system used by the ancient Egyptians. What type of graphic design elements did they contain?

Answers

Answer:

Logographic, syllabic, and alphabetic elements. I think thts what u were asking for?

Explanation:

Which of the following statement about device formatting is FALSE?
A) Device manufacturers store the initial file-system data structures in the device.
B) Operating system can create multiple partitions with in a single device.
C) Volume creation is implicit when a file system is placed directly within a partition.
D) Not every partition contains a copy of the operating systems.

Answers

Answer:

The correct option is;

A) Device manufacturers store the initial file-system data structures in the device.

Explanation:

Before a storage device can be used for data storage, it is required to prepare the device for use and to make the device to become visible to the operating system by formatting of the device

New storage devices are not pre-formatted or come with a ready to use file system as there are different file systems specifically designed for particular  operating systems or operating environment.

Formatting creates partitions, makes the hard drive visible to the operating system and creates a file system that is new such that the storage device can be used for storing files.

Write code that determines the number of full days represented by the number of hours stored in the variable hours and stores that value in the variable full_days. For example, the number of full days in 50 hours is 2. Ignore any leftover hours that don't contribute to a full day. Assume the value of hours has already been initialized. Solve It!

Answers

Answer:

hours = 50

full_days = int(hours / 24)

print("The number of full days in " + str(hours) + " hours is " + str(full_days))

Explanation:

Initialize the hours

Since there are 24 hours in a full day, divide the hours by 24. Note that you need to typecast it to the int, because the result is a decimal value by default

Print the values as requested

The binary string 00100100 is a member of which of the following problems? Remember, a "problem" is a language whose strings represent the cases of a problem that have the answer "yes." In this question, you should assume that all languages are sets of binary strings interpreted as base-2 integers. The exception is the problem of finding palindromes, which are strings that are identical when reversed, like 00100100, regardless of their numerical value.

Answers

This question is incomplete, the complete question is;

The binary string 00100100 is a member of which of the following problems? Remember, a "problem" is a language whose strings represent the cases of a problem that have the answer "yes." In this question, you should assume that all languages are sets of binary strings interpreted as base-2 integers. The exception is the problem of finding palindromes, which are strings that are identical when reversed, like 00100100, regardless of their numerical value.

a) Is the given string a palindromes ?

b) Is the given string a perfect cube?

c) Is the given string greater than 50?

d) Is the given string even?

e) is the given string a perfect square?

Answer:

a) the given binary string is a palindromes

b) the given string is NOT a perfect cube

c) the given string is NOT greater than 50?

d) the given string is an even

e) the given string a perfect square

Explanation:

Given that;

binary string : 00100100

a)

Is the given string a palindromes ?

the given binary string = 00100100

now when you reverse the string, its still going to be : 00100100

so the given binary string is a palindromes

b)

Is the given string a perfect cube

the given string : 00100100 = 36

now 2^3 = 8,

3^3 = 27,

4^3 = 64

so 36 is not a perfect cubic

hence the given string is NOT a perfect cube

c)

Is the given string greater than 50?

the given string : 00100100 = 36

and 36 < 50

so the given string is NOT greater than 50?

d)

Is the given string even?

the given string  : 00100100 = 36

and 36 can be divided exactly by 2

so the given string is an even

e)

is the given string a perfect square?

the given string  : 00100100 = 36

now 6^2 = 36  i.e 6 multiply by 6 = 36

therefore the given string a perfect square

The person who Oversee the direct work of employees and is responsible for the day-to-day tasks the employees complete is likely

Answers

Answer: Operational Manager

Answer: operational manager

Explanation: APEX

ethical issues of cyber bullying

Answers

Answer:

Explanation: As a student, I am aware of the existence of Cyber-bullying and the manner in which it can be carried out. I am also sensitive to the serious nature of the problem. However, I realise that I need to know more about the issue if I am to be effective in fostering a supportive learning environment in which students can grow as good digital citizens.

Cyber-bullying is similar to traditional psychological bullying in that-

There is an imbalance of power between the victim & perpetrator.

Victims draw negative attention & are isolated from their peer group.

Perpetrators are often encouraged & supported by their peer group.

The actions of the perpetrator are deliberate, repeated & relentless.

The negative attention is uninvited & unwanted by the victim.

The effects often cause depression, anxiety, low self-esteem, poorer mental & physical health and school avoidance.

Which of the following is not true about templates?

It incorporates formatting elements.

They slow down the process of creating presentations.

It incoprorates layout options.

It may include content that can be modified.

Answers

The answer is they slow down the creating of presentations.

What do you think is the single greatest physical threat to information systems? Fire? Hurricanes? Sabotage? Terrorism? Something else? Discuss this question and provide support for your answer.

Answers

Answer:

The single greatest physical threat to information systems is:

Sabotage

Explanation:

Sabotage describes the efforts of internal persons to ensure that a system does not operate as intended or is destroyed.  Among the threats to information systems, this is the greatest.  The problem with sabotage is that the operators are internal, they know the system very well.  They understand the weak points and the strengths of the system.  They are internal terrorists to any information system.  These internal saboteurs are capable of using any means to achieve their purpose.  Therefore, it is necessary to scrutinize employees from time to time to discover internal risks.

Help me for this question

Answers

Answer:

Answer C

Explanation:

You are welcome

Instructions
Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a random number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed. import random

Answers

Answer:

The original program is not given; So, I'll just write the program myself in python

import random

x = random.randint(1,10)

y = random.randint(1,10)

result = x * y

print(str(y)+" * "+str(x)+" = "+str(result))

Explanation:

The first line imports random

import random

The next two line generates random numbers between 1 and 10 and save in variables x and y

x = random.randint(1,10)

y = random.randint(1,10)

This line multiplies both numbers

result = x * y

This line prints the result

print(str(y)+" * "+str(x)+" = "+str(result))

The modified program written in python 3 is given below :

import random # import the random module for generating random numbers

a = random.randint(1, 11)#a random integer value between the values (1 and 10) is attached to variable a

b = random.randint(1,11)#a random integer value between the values (1 and 10) is attached to variable b

answer = a * b# multiplies the value of a and b and attach the result to the variable answer

print(str(a) + " * " + str(b) + " = " + str(answer))#displays the operation and result obtained as a string.

Learn more on python programs :https://brainly.com/question/16674303

Many of the first photographers were actullay scientists and inventors

Answers

Answer:

True, if its a true or false. Otherwise I am of no help.

Explanation:

Answer:

True

Explanation:

Other Questions
A scale drawing of a lake has a scale of 1 cm to 80 m. If the actual width of the lake is 1,000 m, what is the width of the lake on the scale drawing? Explain or show your reasoning. People in which of the following classes never paid rent to a landowner? A. serfs B. slaves C. vassals D. peasants Please select the best answer from the choices provided A B C D helpppp meee plz with thisss PLEASE SOLVE IF YOU CAN! Use order of operations to solve!! 6x3-^2-3^4x9+4^0 write an adjective to describe the followingnounsa.skunk a __________ Snake a.cat Matt's cube, after 5 trial, had an average destiny of 7.40. g/cm what is it made of ? 3h-2(4h-5)=10-5h A-0 B-4 C-infinity many solutions D-no solutions Which statement is true about the value of |6|? How are biodiversity and the cycling of matterrelated to maintaining ecosystem services National powers and State powers are most likely to conflict with eachotherA.when they are concurrent.B.when they are exclusive.C.when they are delegated.D.when they are reserved. Which equation has a graph that is a parabola with a vertex at (-2, 0)?y=-2x2.y=(x + 2)2O y = (x - 2)2o y=x-2 Which equation represents a function? Select all that apply. Towards the late 1800's America began to expand into an Empire. Solve for x and y: 10x=5y+5 y=2x-1 Which form of government is Japan?communismdemocracymonarchyrepublic Read the excerpt from "The Coyote and the Bear." "But this is not fair. You have those round things, which are good to eat, but what I took home we cannot eat at all, neither my wife nor I." "But, friend Coyote," answered the Bear, gravely, "did we not make an agreement? Then we must stick to it like men." The Coyote could not answer, and went home. But he was not satisfied. Which element of a morality tale does the excerpt contain? A character makes a decision. A conflict in the story is set up. The moral of the story is revealed. The consequences of a choice become clear. We the People of the United States, in order to form a more perfect Union, establishJustice, insure domestic Tranquility, provide for the common defence, promote the generalWelfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain andestablish this Constitution for the United States of America.-Preamble of the U.S. Constitution, 1787Q: One way the federal government acted to fulfill the purposes of government detailed in theexcerpt was by -A) creating a space agency.B) limiting presidential terms.C) establishing a Supreme Court.D)granting the legislature veto power. Write the expression in radical form. [tex](36x)\frac{1}{2}[/tex] What does b equal??? Which statement best describes slave trade in the United States in the beginning of the 1800s slavery was not an issue at the time. Slavery was abolished in all states Slave trade was outlawed, but it still continued illegallySlavery was illegal, but the government did nothing about it