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
Pleas help I will give brainiest
stellarik [79]
1) A
2)D
3)C
4)A
5)D
Hope this will help u
5 0
2 years ago
Read 2 more answers
Which technique/concept can be use toimplement multiple inheritances<br> in java?
LiRa [457]

Answer:

Interface

Explanation:

Java does not supports multiple inheritance by class, but we can implement multiple inharitacnce in  java using interface, with interface we uses implements keyword.

Example-

Declare interface like below code -

interface parent{

}

and use in child class like below code -

class Child1 implements interface{

}

class Child2 implements interface{

}

8 0
3 years ago
Advanced Sounds is engaging in a full upgrade of its Windows Server 2003 network to Windows Server 2008. The upgrade includes us
Lynna [10]

Answer:

cs

Explanation:

5 0
2 years ago
What does the W in WAN represent
Ilya [14]
WAN stands for Wide Area Network.
7 0
3 years ago
Read 2 more answers
The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
olchik [2.2K]

I guess the best option is B.

The file history utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage location.


7 0
3 years ago
Other questions:
  • In preparing his persuasive presentation, Reza should most likely focus on clearly presenting his
    6·2 answers
  • What are the two most popular applications of theInternet?
    7·1 answer
  • What are some good electronics that I can buy on Amazon?
    14·1 answer
  • How to cancel branly subscription??​
    8·1 answer
  • What happens when a dataset includes records with missing data?
    9·1 answer
  • What is a key function of a scrum master plato answer plz
    13·1 answer
  • Suppose you are developing a data visualization application DataViz which calls some functions from a statistics library class S
    5·1 answer
  • PLEASE HELP ME ASAP!!! Looking at the misty rain and fog (pictured above) Explain at least two defensive driving techniques you
    15·1 answer
  • PLEASE HELP!!<br> Would you ever try and get famous off of social media? Why or why not?
    6·2 answers
  • How would you assign roles to your group members?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!