Pointers are addresses and have a numerical value. You can print out the value of a pointer as cout << (unsigned)(p). Write a program to compare p, p + 1, q, and q + 1, where p is an int* and q is a double*. Explain the results.

Answers

Answer 1

Answer:

#include <iostream>

using namespace std;

int main() {

  int i = 2;

  double j = 3;

 

  int *p = &i;

  double *q = &j;

 

  cout << "p = " << p << ", p+1 = " << p+1 << endl;

  cout << "q = " << q << ", q+1 = " << q+1 << endl;

  return 0;

}

Explanation:

In C++, pointers are variables or data types that hold the location of another variable in memory. It is denoted by asterisks in between the data type and pointer name during declaration.

The C++ source code above defines two pointers, "p" which is an integer pointer and "q", a double. The reference of the variables i and j are assigned to p and q respectively and the out of the pointers are the location of the i and j values in memory.


Related Questions

What input is needed for the defined output?

Answers

A B C values are 1. The logical AND give 1 when both the inputs are one

an event handler is..

a. a word that is open for interpretation.
b. a sentence that provides information.
c. a procedure that occurs as a result of a users action or another source.

Answers

The answer here is C

Answer:

The correct answer is:

Option c. a procedure that occurs as a result of a users action or another source.

Explanation:

First of all, let us define what an event is.

An occurrence that is caused by any external user or entity towards a software or a website is called an event i.e. click from mouse, key pressed from keyboard.

When an event occurs, the software or functionality of the website has to respond to the event. An event handler is a function or procedure that contains the code which has to be run when the event occurs.

When the event occurs, the event handler for particular event is executed.

So from the given options,

The correct answer is:

Option c. a procedure that occurs as a result of a users action or another source.

What is the value stored in the variable myNum after the following assignment statement executes? myNum = 23 % 5

Answers

Answer:

% is a modulus operator in most languages, returning the remainder when the preceding number is divided by the following one .  Assuming the language this question pertains to is one of those, then the answer is 3.

3 is termed as the value stored in the variable myNum after the following assignment statement executes. Thus, option D is correct.

What is the modulus operator?

The modulus operator, which operates between two accessible operands, is an addition to the C algebraic expressions. To obtain a result, it divides the supplied numerator by the supplied denominator. To put it another way, it results in an equal dividing remainder. As a result, the leftover amount is likewise very much an integer.

After executing the following assignment statement, the value stored in the variable myNum is 3. Because the modulus operator (%) returns the remainder of a division operation, this is the case. In this case, 23 divided by 5 yields 4 with a remainder of 3, indicating that the value stored in myNum is 3

Therefore, option D is the correct option.

Learn more about modulus operator, here:

https://brainly.com/question/13103168

#SPJ2

The question is incomplete, the complete question is:

What is the value stored in the variable myNum after the following assignment statement executes? myNum = 23 % 5

option :

1

2

5

3

Always place the smallest dimensions ____ the object, with ____ the object.
Question 2 options:

A) closest to; progressively smaller dimensions outward from

B) closest to; progressively larger dimensions outward from

C) farthest from; progressively smaller dimensions above

D) farthest from; progressively larger dimensions above

E) none of the above

Answers

The answer is B (Closest to; progressively larger dimensions outward from

What is the name for non-paid active links returned by an Internet search engine in the search results?
O sponsored links
O organic links
O dead links
O relevant links

Answers

Answer: b

Explanation:

A method used to return the value of one of the attributes of an object is called a/an:________

a. retriever (finder)
b. constructor (maker)
c. accessor (getter)
d. mutator (setter)

Answers

Answer:

a. retriever (finder)

Explanation:

In Macintosh computers, the Finder or retriever is a desktop interface. It can be used to find, navigate, open, delete, copy or move files and can open files or folders around the desktop. When the Finder is relaunched, it simply starts the application. It is a method used to return the value of one attributes of an object. It is also called as retriever.

Unless otherwise specified, entire arrays are passed __________ and individual array elements are passed __________.

Answers

Answer:

By reference ; by value

Explanation:

An array is defined as the arrangement of a certain item in a well orderly manner/ fashion.

Unless otherwise specified, entire arrays are usually passed by reference and individual array elements are passed by value which is the standard norm in the mode of operations.

What is the main reason for assigning roles to members of a group?

Answers

So that people with strengths in different areas can work on what they do best, plus it divides the workload.

What is the shortcut key to “Left Align” the selected text

Answers

Explanation:

The shortcut key to"left align" the selected text is Control+L

heyyy y’all hope your day was great

Write a Python program to keep track of data for the following information in a medical clinic: doctors, patients, and patient_visits

Patients and Doctors have an ID, first name, and last name as common attributes. Doctors have these additional attributes: specialty (e.g. heart surgeon, ear-nose-throat specialist, or dermatologist), total hours worked, and hourly pay. Further, doctors keep track of the patient_visits. A patient_visit has the following attributes, number_of_visits to the clinic, the patient who is visiting, the doctor requested to be visited, and the number of hours needed for consultation. Based on the number of consultation hours, the doctor will get paid.


The following functions are required:

1. addVisit: this function adds a patient_visit to the doctor. A new visit will NOT be added if the doctor has already completed 40 hours or more of consultation. If this happens, an error is thrown mentioning that the doctor cannot have more visits this week.

2. calculatePay: this function calculates the payment for the doctor using the following logic: Each hour is worth AED 150 for the first two visits of the patient and all further visits are billed at AED 50.


3. calculateBill: this function calculates the bill for the patient, which displays the doctor's details, patient details, and payment details. An additional 5% of the total is added as VAT.


The student is required to identify classes, related attributes, and behaviors. Students are free to add as many attributes as required. The appropriate access modifiers (private, public, or protected) must be used while implementing class relationships. Proper documentation of code is mandatory. The student must also test the code, by creating at-least three objects. All classes must have a display function, and the program must have the functionality to print the current state of the objects.

Answers

This is too much to understand what you need the answer too. In my opinion I can’t answer this question

The National Vulnerability Database (NVD) is responsible for actively performing vulnerability testing for every company's software and hardware infrastructure. Is this statement true or false?A. TrueB. False

Answers

Answer:

False

Explanation:

The answer to this question is false. This is because the NVD doesn't perform such tests on their own. Instead they they rely on third-party vendors, software researchers, etc to get such reports and do the assignment of CVSS scores for softwares

The National Vulnerability Database (NVD) is the United State governments leading resource for software vulnerability

Write a program that takes two decimal numbers as input and print the largest. If the numbers are equal, print one of them.

Answers

print(max(float(input("Enter a decimal number: ")),float(input("Enter a decimal number: "))))

This would be the simplest way to do it. Best of luck.

Suppose an application generates chunks 60 bytes of data every 200msec. Assume that each chunk gets put into a TCP packet (using a standard header with no options) and that the TCP packet gets put into an IP packets. What is the % of overhead that is added in because of TCP and IP combines?
1) 40%
2) 10%
3) 20%
4) 70%

Answers

Answer:

1) 40%

Explanation:

Given the data size = 60 byte

data traversed through TSP then IP

Header size of TCP = 20 bytes to 60 bytes

Header size of IP = 20 bytes to 60 bytes

Calculating overhead:

By default minimum header size is taken into consideration hence TCP header size = 20 bytes and IP header size = 20 bytes

Hence, the correct answer is option 1 = 40%

What is the best use of network in homes

Answers

Answer:

Spectrem

Explanation:

Designing the right elements for the tasks that the user is attempting to perform is called ________.

Answers

Answer:

Interface design

Explanation:

INTERFACE DESIGN are design that are carried out on either a computer or a mobile phone or other devices that will suit the users by designing the style of the devices and how the device will look like which will inturn enable the user to easily carried out or performed any tasks they are want to perform with easy and without any lapses which is why it is important for INTERFACE DESIGN to be design with the right tools that the user can easily understand in order to access and perform their tasks effectively.

Which IP QoS mechanism involves prioritizing traffic? Group of answer choices IntServ RSVP COPS DiffServ None of the above

Answers

Answer:

DiffServ

Explanation:

The IP QoS which is fully known as QUALITY OF SERVICE mechanism that involves prioritizing traffic is DIFFERENTIATED SERVICES (DiffServ).

DIFFERENTIATED SERVICES help to differentiate ,arrange ,manage, control and focus on network traffic that are of great significance or important first before network that are less important or by their order of importance in order to provide quality of service and to avoid network traffic congestion which may want to reduce the quality of service when their is to much load on the network .

What is the missing line of code?

>>> phrase = "You are amazing!"
>>> _____
'u a'

phrase[3:6]

phrase[2:6]

phrase[3:5]

phrase[2:5]

Answers

Answer:

phrase[2:5]

Explanation:

Given:

The above code segment

Required

Which instruction returns 'u a'

First, we need to get the index of u in the phrase:

u is at the third position but in programming, index starts at 0.

So, u is at index 2

Next, we need to get the index of a in the phrase:

a is at index 4

One of the ways to return a sub string from a string in python is [tex]string[start:stop+1][/tex]

Where:

[tex]start = 2[/tex] ----- index of u

[tex]stop = 4[/tex]  ----- index of a

phrase ---- The string variable

So, the instruction that returns 'u a' is: [tex]phrase[2:5][/tex]

Where 5 = 4 + 1

Answer:

phrase[2:5]

Explanation: got it right on edgen

Gavin is making a new logo for his business. He uses drawing software to create a unique. Which file format does he use to create a logo
A Vector
B PDF
C Bitmap
D Raster

Answers

Answer:

Vector

Explanation:

vector graphics are made up of paths, each with a mathematical formula (vector) that tells the path how it is shaped and what color it is bordered with or filled by.

1. Normal view
the place where information for handouts can be added
2. Notes view
provide rows of icons to perform different tasks
3. Slide pane
the working window of a presentation
4. Title bar
displays thumbnails
5. toolbars
provides filename and Minimize icon

Match the feature to its function.

Answers

Answer:

1.- display thumbnails, 2.-the place where info can be put, 3.- working window of presentation 4.- provides file name, 5.- rows of icons to perform task ... I'm not sure if these are correct but I tried

1. Normal view

the working window of a presentation

2. Notes view

the place where information for handouts can be added

3. Slide pane

displays thumbnails

4. Title bar

provides filename and Minimize icon

5. Toolbar

provide rows of icons to perform different tasks

A developer wants to take existing code written by another person and add some features specific to their needs. Which of the following software licensing models allows them to make changes and publish their own version?


Open-source


Proprietary


Subscription


Software-as-a-Service (SaaS)

Answers

Answer:

open-source

Explanation:

open-souce software allows any user to submit modifications of the source code

What is better to use for start Python or Java?

Answers

Answer:

here is your answer ......

hope it helps......

Answer:

python is better

Explanation:

because its my favourite

On line two, you take a string, word, as input. Then, using that string...
1. In the first line of your output, print the third character of this string.
2. In the second line, print the second to last character of this string.
3. In the third line, print the first five characters of this string.
4. In the fourth line, print all but the last two characters of this string.
5. In the fifth line, print all the characters of this string with even indices
(remember indexing starts at 0, so the characters are displayed starting
with the first)
6. In the sixth line, print all the characters of this string with odd indices
(1.e. starting with the second character in the string).
7. In the seventh line, print all the characters of the string in reverse order.
8. In the eighth line, print every second character of the string in reverse
order starting from the last one.
9. In the ninth line, print the length of the given string,

Answers

Answer:

7

Explanation:

This one obtains results that the others in particular do not have, whether it is even one more word or another initial sentence

Assume the clock for a 4-bit binary counter is 80 kHz. The output frequency of the fourth stage (Q3) is

Answers

Answer:

5kHz

Explanation:

There are four stages so N = 2⁴ = 16.

The frequency at nth stage is given by

[tex]f_n = \frac{f_{clk}}{N} = \frac{80kHz}{16} = 5kHz[/tex]

The output frequency of the fourth stage (Q3) is 5kHz. Thus the correct option is A.

What is a 4-bit binary counter?

On each clock cycle, the 4-bit synchronous counter successively counts up from 0 (0000) to 15 as outputs ( 1111 ). It is also known as a 4-bit Synchronous Up Counter as result.

We required four Flip Flops to create a 4-bit counter, as indicated by the number 4 Flip Flops. The counter also has a reset pin, which enables it to enter an all-zero mode in which its output is "0."

The Q output of the previous flip-flop triggers the CLK input in the 4-bit counter above, as opposed to the Q output as in the up counter configuration, where the output of each flip-flop changes state on the rising edge.

There are four stages so N = 2⁴ = 16.

The 4-bit binary counter is 80 kHz.

In order to calculate the output frequency the  4-bit binary counter is divided by 16 which is equal to 5kHz.

Therefore, option A  is appropriate.

Learn more about the 4-bit binary counter, here:

https://brainly.com/question/29894384

#SPJ5

The complete question is Probably

Assume the clock for a 4-bit binary counter is 80 kHz The output frequency of the fourth stage (Q3) is. a) 5kHz. b) 10 kHz. c) 20 kHz. d) 320 kHz.

Write one kid-friendly paragraph about a Software Developer's salary,.

Answers

According to BBC America, Software Developers made a median salary of $103,620 in 2018. The best-paid 25 percent made $130,460 that year, while the lowest-paid 25 percent made $79,340. The software developer field is growing in both salary and job volume. The BLS projects the software development (applications) field will grow by about 26% by 2028, with 241,500 jobs added by that time. This is compared with an estimated 12% growth for those in computer occupations.

Use Python
The Fibonacci sequence starts 1, 1, 2, 3, 5, 8, . . .. Each number in the sequence (after the first two) is the sum of the previous two. Write a program that computes and outputs the nth Fibonacci number, where n is a value entered by the user.
SAMPLE RUN
--- Prompts For Keyboard/Console/Standard Input ---
Enter n:
Inputs
--- Keyboard/Console/Standard Input stdin ---
4
Outputs
--- Monitor/Console/Standard Output ---
Enter n: 4
The Fibonacci number is 3

Answers

Answer:

terms = int(input("Enter n? "))

n1 = 0

n2 = 1

count = 0

while count < terms:

   nterm = n1 + n2

   n1 = n2

   n2 = nterm

   count += 1

print(n1)

Explanation:

This prompts user for n

terms = int(input("Enter n? "))

The next lines initialises the first two terms of the series

n1 = 0

n2 = 1

This initialises count to 0

count = 0

The following iteration is used to determine the number at the nth position

while count < terms:

   nterm = n1 + n2

   n1 = n2

   n2 = nterm

   count += 1

This prints the required number

print(n1)

putting commands in correct order so computers can read the commands

a. debugging
b. sequencing
c. conditionals

Answers

Answer:

its b I think I'm pretty sure

2. The Warren Commission investigated the assassination of President _______________________ in 1964.

Answers

Answer:

President Kennedy

Explanation:

John F. Kennedy was the 35th President of US. He was assassinated in 1963 in Dallas

Relatively simple CRUD (create, read, update, delete) web applications development can be facilitated with: _________.
a. HTTP
b. HTTPS
c. Web Application Frameworks
d. Cascading Style Sheets (CSS)
e. Document Object Model (DOM)

Answers

Answer:

c. Web Application Frameworks

Explanation:

Web Application Frameworks is a form of a software framework that is made to perform support for the building of web applications such as web services, web resources, and web APIs. Web frameworks.

Also, Web Application Frameworks automatically perform the function of primary activities carried out in web development such as create, read, update, delete.

Hence, in this case, the correct answer is Web Application Framework.

8. Write the examples of freeware and Shareware softwares ?

Answers

Explanation:

People use freeware software because it is available free of cost and it can be distributed free of cost, that is why it is called FREEware.

Freeware software:

Adobe PDF

yahoo messenger

Go.ogle Talk

MSN messenger

People use shareware software because it helps them to know about the product more before buying it and this software is available free of cost.

Shareware software:

Adobe acrobat 8 professional

Winzip

Getright

MVC stands for Model-View-Controller. Where is business data and logic mainly kept?
Views
Controllers
Models
None of the above

Answers

Answer:

Controllers

Explanation:

Business Logic goes to Model part in MVC . Role of Model is to contain data and business logic. Controller on the other hand is responsible to receive user input and decide what to do. A Business Rule is part of Business Logic .

Other Questions
governments.The three most common government systems include confederate, federal, andA. unitaryB. monarchicalC. dictatorialD. democraticPlease select the best answer from the choices providedABD Question is in the image what is 8000 divided by 8 Please i will give brainliest i need to know asap Confucianism has had a major impact on Chinese history by promoting A. Resistance to authority B. Unity with the dao C. The importance of a strong central government D. The value of the filial piety in creating social harmony Find the measure of angle A Which factors affect seasons on earth Evaulate A+7 when a=4 Which of the following does notdescribe DNA?A. contains genetic informationB. double helixC. coils to form chromosomesD. located in the lysosomes What is the purpose of a personal narrative? What effect should it have on readers? Which conflict is best represented in this line of dialogue? "What kind of world is it where all I have to be proud of is a reputation for being a hood, and greasy hair? I don't want to be a hood...I don't steal things...I'm marked lousy Is it important to use varied methods when creating digital media presentations? Why or why not?Yes, because no one method is capable of adequately delivering the information.No, because using more than one method is confusing to the audience.No, because the different methods are incompatible with each other.Yes, because it makes the presentation more interesting for the audience. Heyyy. some of yall are sad and need ppl to talk to so tell me about everything thats been happening:) not weird just need ppl to talk to and I dont want ppl to feel alone- a line passes through the point (4,9) and has a slope of 5/2.Write an equation in slope-intercept form for this line. I REALLY NEED HELP please somebody Solve for x.21x 420x Find the coefficient of x^2 y^3 in the expansion of (-4x+y)^5. Give your answer as an integer. Which of the following was NOT a reason for United States to look beyond its boundaries in the late nineteenth century? A. to sell surplus goods and procure raw materials B. to provide jobs for its surplus of industrial workers C. to spread Christianity to those it considered inferior D. to civilize the inferior races in Asia and Africa E. to establish military alliances with other nations Read these statements by three students who are discussing the beginning of the book Holes by Louis Sachar.Haley: How do you think Stanley feels when he first arrives at Camp Green Lake?Micah: Based on his reactions to Mr. Sirs directions, he is probably confused and unsure about what his life will be like at Camp Green Lake.Kristy: I think Stanley feels lost and confused. One minute hes going to school and the next minute hes on a long bus ride in the middle of the desert.Which statement best describes Haleys role in this discussion?She is leading the discussion.She is stating the ground rules.She is responding to a speaker.She is questioning the moderator. Describe the movement of melanin in the skin.