subject

A) Pointers, Dynamic allocation and variables DECLARE a regular integer variable 'intVar' and assign it a value of 42.
DECLARE an int pointer variable 'ptrInt'.
ASSIGN the address of intVar to ptrInt.
Cout out the dereferenced value of ptrInt.
ASSIGN to 'ptrInt' using dereferencing(*), the value of '23'.
Cout out the dereferenced value of ptrInt.
DECLARE an int poiner Variable ptrInt2.
Assign dynamically allocated 'new int' to ptrInt2.
ASSIGN to prInt2 using dereferencing, the value of '42'.
Cout the dereferenced value of ptrInt2.
(Run the code to be sure it work, turn-in the code and screen prints)
B) Pointers and arrays
DECLARE two pointer variables of type int named: intArray and copyIntArray
Dynamically (new int[#]) create an array of 100 integers and ASSIGN(=) the address to intArray
Write a for loop to assign the index( 0 to 99) of 'intArray' to be the value of the array
Write a for loop to cout the values of each element in the 'intArray' array.
ASSIGN just the address of 'intArray' TO 'copyIntArray'.
Write a for loop to cout the values of each element in the 'copyIntArray' array.
Deallocate the intArray and copyIntArray.
(Run the code to be sure it work, turn-in the code and screen prints)
Summary of what you learned.
C) Pointers and classes.
Given the class definition of a Watch.
Write the body for each of the public functions.
class Watch{
public:
Watch(int, int, int);
Watch();
int hour();
int minute();
int second();
void tick();
void reset(int, int, int);
private:
int hour_;
int minute_;
int second_;
};
DECLARE a pointer variable named myWatch, using the 'Watch' class/datatype.
Using the variable myWatch, dynamically DECLARE(new Watch) and ASSIGN (=) a Watch ... to myWatch.
Assign a value of 12 to hours, a value of 30 to minutes and a value of 0 to seconds.
Write a cout statement to print out (cout) the values hour, minutes and seconds in the format hh:mm:ss (e. g., 12:30:00).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Howard is designing a chair swing ride. the swing ropes are 5 meters long, and in full swing they tilt in an angle of 29° outside chairs to be 2.75 m above the ground in full swing.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 24.06.2019 11:30
Why is body language an important factor in a business meeting
Answers: 1
question
Computers and Technology, 25.06.2019 04:20
Many prestigious universities have a system called a “legacy preference system” which is used to decide which applicants should be accepted to the university. if an applicant’s parent is an alumnus of the university, the applicant will be admitted with lower gpa and sat scores than if the parent is not an alumnus. (there is currently a lot of discussion about the fairness of this system, but universities get a lot of money from their alumni so they are unwilling to change ) your assignment for mp2 is to implement a computerized system like this for a very small prestigious university. the university has two schools, liberal arts and music, each with their own criteria for accepting students. your program must read in certain information about an applicant and print a message saying whether the applicant should be accepted or not.
Answers: 2
You know the right answer?
A) Pointers, Dynamic allocation and variables DECLARE a regular integer variable 'intVar' and assig...
Questions
question
Mathematics, 26.09.2021 01:10
question
Mathematics, 26.09.2021 01:10
question
Mathematics, 26.09.2021 01:10
question
English, 26.09.2021 01:10
question
Mathematics, 26.09.2021 01:10
Questions on the website: 13722362