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
yarga [219]
2 years ago
5

Summary In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.c

pp, calculates your age in the year 2050. Instructions Declare an integer variable named myNewAge. Declare and initialize an integer variable named myCurrentAge. Initialize this variable with your current age. Declare and initialize an integer variable named currentYear. Initialize this variable with the value of the current year. Use four digits for the year. Execute the program by clicking the Run button at the bottom of the screen. Sample program execution: My Current Age is 29. I will be 65 in 2050.
I am not sure how to add my output.

This is what I have so far:

// This program calculates your age in the year 2050.

// Input: None // Output: Your current age followed by your age in 2050

#include using namespace std;

int main()

'currentYear'; /2019/.match('currentYear') =>MatchData "2019"

'myCurrentAge'; /20/.match('myCurrentAge') => > "My Current Age is" count >> 'myCurrentAge'

int 'currentYear'

'currentYear'= 2019;

count >> "Current Year"

count >> 'currentYear'

int 'myNewAge'

'myNewAge'= 51;

count >> "I will be"

count >> 'myNewAge'

51 = 20 + (2050 - 2019);

cout << "My Current Age is " << 20 << endl;

cout << "I will be " << 51 << " in 2050." << endl;

return 0; }
Computers and Technology
1 answer:
AVprozaik [17]2 years ago
7 0

Answer:

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>  int myNewAge;</em>

<em>  int myCurrentAge = 29;</em>

<em>  int currentYear = 2020;</em>

<em> </em>

<em>myNewAge = myCurrentAge+(2050-currentYear);</em>

<em />

<em>cout<<"My Current Age is "<<myCurrentAge<<". I will be "<<myNewAge<<" in 2050"<<endl;</em>

<em>    return 0;</em>

<em>}</em>

Explanation:

The program is written in C++ language as required. firstly, we declare the three variables:

<em>  </em><em>int myNewAge;</em>

<em>  int myCurrentAge = 29;</em>

<em>  int currentYear = 2020;</em>

Then we calculate the new age as: <em>myNewAge = myCurrentAge+(2050-currentYear);</em>

Using multiple cout operators (<em> </em><<) we display the output nicely as required by the question with this statement

<em>cout<<"My Current Age is "<<myCurrentAge<<". I will be "<<myNewAge<<" in 2050"<<endl;</em>

You might be interested in
HELP FAST
Ghella [55]

Answer:

spelling errors and/or punctuation errors

4 0
2 years ago
Diffreciate between primary source of information and secondary source of information​
poizon [28]

Answer:

Primary is firsthand, secondary is viewed through articles and other materials.

Explanation:

EX: Primary account of a story, secondary view through pictures.

8 0
3 years ago
Cursor/Blinking line is used to show current_ on document. A- Color b- Status c- Type d- Location
Natalija [7]

Answer:

d. Location

Pretty sure this is it.

7 0
2 years ago
3.A ball is thrown into the air with an initial velocity of 15 m/s. a.How long does it take the ball to reach maximum height?b.W
ehidna [41]

Answer:  a) = 1.5 sec.  b= 11.5 m. c=0  d= 1.5 sec.

Explanation:

a) Once thrown into the air , the only influence on the ball is gravity, so, we can conclude that the acceleration acting on the ball is the one due to gravity, i.e., g= 9.8 m/sec².

Applying the definition of acceleration, we can write the following equation:

a= (vf-vo) / t   ⇒ g = vf-vo / t. (1)

Now, when the ball reaches to his maximum height, it stops momentarily, and then starts to fall, so for this height, we can write vf=0.

Replacing  in (1), and solving for t, we get:

t = (0 -vo) / g = -15 m/s/ - 9.8 m/sec² (Taking upward as positive  direction)

a) t= 1.5 sec.

Replacing this value in the kinematic equation for displacement, when vo=15 m/s, we get:

hmax: 15 m/sec . 1.5 sec -1/2. 9.8 m/sec². (1.5 sec) ² (2)

b) hmax= 11.5 m

c) vf= 0 (as explained above)

Finally, in order to know how long the ball takes to return to its initial height, we know that for the falling part of the trajectory, vo=0, so we can write the equation for displacement as follows:

h=-hmax (because it returns to the same starting point)= 1/2 gt²=-11.5 m

Solving for t, we get:

d) t=1.5 sec.

It can be seen that the time used in going up, it is the same for going down, to travel the same distance.

This result is completely general and applies to any free fall problem.

3 0
3 years ago
Fred opens a web browser and connects to the www.certskills.com website. Which of the following are typically true about what ha
Masja [62]

Answer:

c. Messages flowing to the client typically use a source TCP port number of 80.

d. Messages flowing to the server typically use TCP.

Explanation:

When fred open the web browser and start a connection to the www.certskills.com website.Two things happens from the mentioned things

1.Messages that are going to the server are use TCP(Transmission Control Protocol).

2.Message goes to the client uses port number 80 that is of TCP used for transferring web pages.

Because the port number 80 is reserved for the HTTP used for transferring web pages that uses TCP protocol.

4 0
3 years ago
Other questions:
  • Why did LISD had to block the game “among us”?
    8·2 answers
  • Can Someone give me a 5 paragraph essay about all of the uses in Microsoft Word.
    9·1 answer
  • In step 2 of the mail merge process you must be prepared to
    6·2 answers
  • You can upgrade a cpu by adding registers and cache memory to it. <br> a. True <br> b. False
    7·1 answer
  • Web browsers are used to browse the world wide web.
    5·2 answers
  • What is the trickiest time of the day to drive? A. Early morning B. Late night C. After the sun sets
    8·2 answers
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    6·2 answers
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • Professional communication must be objective,
    8·1 answer
  • What kind of energy transformation occurs when you call someone on a cell phone?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!