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
What is the term for the error caused when one end of an unshielded twisted-pair (UTP) cable is terminated in the T568A configur
FinnZ [79.3K]

Answer:

A transposition is the correct answer.

Explanation:

A transposition is the type of encryption that caused when one side of the unshielded twisted pair cable is finished in the configuration of  T568A and at the other side of the configuration of T568B, it is also termed as error or cipher. So, that's why the following answer is true.

7 0
2 years ago
Which of these image sizes takes the most storage space?
jeyben [28]
The answer would be C. Kilobyte
3 0
3 years ago
Read 2 more answers
The function below takes one parameter: a string (date_string) containing a date in the mm/dd/year format. Complete the function
Natalija [7]

Answer:

The solution code is written in Python 3.

  1. def convertDate(date_string):
  2.    date_list = date_string.split("/")
  3.    for i in range(0, len(date_list)):
  4.        date_list[i] = int(date_list[i])
  5.    return date_list  
  6. print(convertDate('06/11/1930'))

Explanation:

Firstly, create a function convertDate() with one parameter, <em>date_string</em>. (Line 1).

Next, use the Python string <em>split()</em> method to split the date string into a list of date components (month, day & year) and assign it to variable <em>date_list</em>. (Line 3) In this case, we use "/" as the separator.

However, all the separated date components in the <em>date_list</em> are still a string. We can use for-loop to traverse through each of the element within the list and convert each of them to integer using Python<em> int() </em>function. (Line 5 - 6)

At last return the final date_list as the output (Line 8)

We can test our function as in Line 11. We shall see the output is as follow:

[6, 11, 1930]

8 0
2 years ago
Camille prepared excellent PowerPoint slides for her speech about education reform, but the speech didn't go as well as she had
Elanso [62]

Answer:

The answer is "she uses the keyboard unless she could quickly progress the slides".

Explanation:

Planning is the single least key aspect of having the performance effectively. It is a critical foundation and which can dedicate much space as possible to it and avoids loopholes.  

  • It is the proper planning that may also ensure, that you have fully considered.  
  • It is the thing, which we need to convey into your delivery and will also help to boost your trust.
6 0
3 years ago
You want to divide the value in cell D3 by the value in cell E3. Which formula should you use?
Tom [10]
The formula is:
=D3/E3
4 0
2 years ago
Read 2 more answers
Other questions:
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    7·1 answer
  • Stefan is finalizing his presentation by adding media files and preparing it for distribution. Stefan knows that saving a presen
    13·1 answer
  • Why is wearable technology important?
    12·1 answer
  • 2. Identify the diagram and define it.<br>13. What are pollen grains ?<br>4. What is an embryo?​
    12·1 answer
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • Create a PHP page that contains an array of at least 20 movie titles or book titles (your choice). The HTML page should have an
    7·1 answer
  • Expectation on Information Technology Fundamental​
    12·1 answer
  • HEPME <br> ZOOM<br> IN <br> STOP<br> GIVIJG<br> ME <br> LINKS <br> !!
    9·1 answer
  • Determine which system you would recommend each of the customers use based on their provided user and system specs.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!