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
In a computer instant messaging​ survey, respondents were asked to choose the most fun way to​ flirt, and it found that ​P(D)equ
MA_775_DIABLO [31]

Answer:

P(D) = 0.4

Explanation:

P(D) is the probability of randomly selecting someone.

who does not choose a direct​ in-person encounter as the most fun way to flirt.

1 – 0.600 = 0.4

P(D) = 0.4

hence the upper D over bar right parenthesis represent and its value is 0.4

8 0
3 years ago
Kevin is a DJ and has a passion for creating and modifying audio tracks. Which application software facilitates him in his passi
stiv31 [10]
B. Multimedia software
5 0
3 years ago
Identify the device used to convert an information signal to a signal compatible with the medium over which it is being transmit
seropon [69]

Answer:

A modulator

Explanation:

This device is called a modulator and it does the task of modulation. The act of modulation influences data information on the carrier, allowing signal to be sent over a bandpass frequency range.

The Modulator is what controls an input audio signal which is called a carrier. It does not make a sound. What it does instead is to change the original carrier sound wave. The work of the Modulator as evident in the question is the conversion of information signal to a signal compatible with the medium over which it is going to be transmitted.

7 0
3 years ago
How do I make a stepper motor turn clockwise?
oksano4ka [1.4K]
Just reverse the connections to one winding and the motor will go the other way, I believe.
5 0
4 years ago
Over the last ten years, what has caused the audience ratio of three major networks, CBS, NBC, and ABC from 90 percent to 60 per
Goryan [66]
D is your answer good luck
5 0
4 years ago
Other questions:
  • Describe the concepts of confidentiality, integrity, and availability (C-I-A), and explain each of the seven domains of a typica
    9·1 answer
  • Maia notices that her paragraphs are too close to one another. She wants to increase the space. Which arrangement of steps does
    6·2 answers
  • You get a BRAINLIEST if you help me ASAP!
    11·2 answers
  • When you insert a photo into a document, its placed at the ​
    13·2 answers
  • While there are a some exceptions such as an if-statement, Scheme has one primary syntax () a) True b) False
    14·1 answer
  • When you go to a website, your web browser requests a web page from:
    11·1 answer
  • Ses
    15·1 answer
  • 1.What is the output of the following program? [10 Marks]namespace ConsoleApp1{class Program{static void Main(string[] args){int
    13·1 answer
  • Which of the following is/are used in multimedia?
    14·1 answer
  • Flash drive / USB is ___________ device. A)Input B)Output C)Internal D)None of these
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!