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
Is it possible to code your own game and if so then where should I go to learn and how to publish it?
const2013 [10]

Answer:

Yes there is

Explanation:

It is scratch a coding game to do almost anything you can also code flappybird

Hope this helps.

Have fun with scratch

4 0
2 years ago
Read 2 more answers
Comments should be written in what type of language
jeyben [28]
Comment should always be answered in the prospective language the question is asked.
8 0
3 years ago
When replacing a system board in a laptop, which feature is a must?
Sphinxa [80]
I would use a dual core Becuase a quad can be too space consuming and it can overheat the computers software
6 0
3 years ago
Which of the following connects the processor to the chipset and memory on the motherboard? a. Thread b. FSB c. BIOS d. ALU
IRISSAK [1]

Answer:

The correct Answer is (b) FSB

Explanation:

The chipset is the "superglue" that bonds the microprocessor to the rest of the motherboard and so to the rest of the computer. On a computer, it consists of two basic parts -- the Northbridge and the southbridge. All of the numerous modules of the computer communicate with the CPU over the chipset.

The northbridge joins straight to the processor via the front side bus (FSB). A memory controller is situated on the northbridge, which gives the CPU fast access to the memory. The northbridge also attaches to the AGP or PCI Express bus and to the memory himself.

3 0
3 years ago
Scripts based on other sources, such as short stories, novels, or biographies, are known as _____.
Sedaia [141]

Answer: adapted screenplays

Explanation:

you’re basing your script based off of other sources and stuff.

8 0
3 years ago
Other questions:
  • To protect your answers after completing an assignment, what should you do? close your browser window. let someone else start wo
    14·1 answer
  • A fitness tracker can be classified as a wearable computer. true
    9·1 answer
  • Select the most likely outcome of making only on-time minimum payments to a credit card with a balance for an entire year?
    7·2 answers
  • PLEASE HELPPPPPPP
    15·1 answer
  • Useful open source applications include the popular Web browser Mozilla Firefox, the e-mail application Thunderbird, the relatio
    7·2 answers
  • What protections do not apply to the content in a wiki?
    5·2 answers
  • Computer father known as​
    5·1 answer
  • What is the collection of programs designed to operate control and manage the actual operation of the computer equipment​
    14·1 answer
  • Write the steps involving coping and pasting a file in a folder​
    5·1 answer
  • Emily is deciding whether to buy the same designer jacket her friends have. The jacket is much more expensive than a similar one
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!