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]
3 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]3 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
Which of the following can be used to determine how much traffic a website is getting?
Bumek [7]
Analytics can be used to determine the amount traffic a website is getting. The correct option among all the options that are given in the question is the second option. Web analytics is used to determine several important information’s about a website. This feature can also be used to determine the region from which the maximum and the minimum traffic is arriving. Based on the information’s received from analytics, the website owner can take steps to improve the amount of traffic that is coming to the website.



6 0
3 years ago
Question 1 of 30
Paha777 [63]
It’s exercise tax $5 tax on a cable television line

hope this helped

~ mo
7 0
3 years ago
4. Write a program to calculate square root and<br>cube root of an entered number .​
nataly862011 [7]

Answer:

DECLARE SUB SQUARE (N)

CLS

INPUT “ENTER ANY NUMBER”; N

CALL SQUARE(N)

END

SUB SQUARE (N)

S = N ^ 2

PRINT “SQUARE OF NUMBER “; S

END SUB

3 0
3 years ago
What is the default view in a Word document?
boyakko [2]
Wouldn’t be A, C. When editing a word document it would be B and when just opening one from someone it would be D. This question doesn’t give a brief explanation of what’s happening. Can you give more information or is that all of the question?
3 0
2 years ago
When opening the Microsoft® Publisher® application, a user can choose all of the following EXCEPT.
lora16 [44]

Answer:

Explanation:

Publisher can help us with different marketing tasks but never is the same job that a professional working in Photoshop or Corel draw, but if we can make simple marketing tasks is enough.

We can do different tasks in publisher for example:

  • Newsletters
  • Signboards
  • Postcards
  • Invitations cards
  • Greeting cards
  • Business cards
  • Letterhead
  • Envelopes
  • Forms
  • Banners
  • Calendars
  • Brochures
  • Catalogs
  • Prospects
  • Advertisements
  • Diplomas
  • Gift vouchers
  • Tags
  • Greeting cards
  • Menus Programs
  • Airplanes Paper Figures
7 0
3 years ago
Other questions:
  • Answer this question please
    6·1 answer
  • The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
    12·1 answer
  • Your program will demonstrate use of arrays, searching an array, using methods, passing parameters by reference, returning value
    13·1 answer
  • While reviewing some web page code, you notice that the html is written in all lowercase letters. you are not sure which version
    14·1 answer
  • Given :an int variable k,an int array currentMembers that has been declared and initialized ,an int variable nMembers that conta
    12·1 answer
  • Bran is writing a book on operation system errors. Help him complete the sentences.
    7·1 answer
  • If a menu item requires additional information from the user, the Windows standard is to place a(n) ____ at the end of the capti
    12·1 answer
  • Write a class "Dog" with a private int field called months and two public member functions setAge and GetStage. setAge takes as
    13·1 answer
  • PLEASE HELP. I’ll mark you BRAINLIST <br> Please read the comment under this question
    9·1 answer
  • Price of ETH coin right now?<br> Don't answer if u don't know.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!