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
Nadusha1986 [10]
3 years ago
13

In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.cpp, calc

ulates your age in the year 2050.​
Computers and Technology
1 answer:
Ne4ueva [31]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main() {

int currentYear = 2020;

int myCurrentAge = 23;

int myNewAge=myCurrentAge+(2050-currentYear);

cout << "My Current Age is " << myCurrentAge << endl;

cout << "I will be " << myNewAge << " in 2050." << endl;

}

Explanation:

  • Initialize the currentYear with 2020 and myCurrentAge with 23.
  • Add myCurrentAge with the the result of (2015 - currentYear) and assign this result to myNewAge variable.
  • Finally display my current age and after that display the new age in 2050.

Output:

My Current Age is 23

I will be 53 in 2050.

You might be interested in
What is the binary number for 5?
Softa [21]

Answer:

the binary code for "5" is 00000101

8 0
2 years ago
If an if- else statement is true, it will include which kinds of results?
Salsk061 [2.6K]

In an if...else statement, if the code in the parenthesis of the if statement is true, the code inside its brackets is executed. But if the statement inside the parenthesis is false, all the code within the else statement's brackets is executed instead.

Of course, the example above isn't very useful in this case because true always evaluates to true. Here's another that's a bit more practical:

#include <stdio.h>

int main(void) {

int n = 2;

if(n == 3) { // comparing n with 3 printf("Statement is True!\n");

}

else { // if the first condition is not true, come to this block of code

printf("Statement is False!\n"); } return 0;

}

Output:

Statement is False!

5 0
3 years ago
Pressing the Ctrl+Home keys moves the insertion point to the
rewona [7]
I'm going to go with A
5 0
2 years ago
For an activity with more than one immediate predecessor activity, which of the following is used to compute its earliest finish
laila [671]

Answer:

The correct option is A

Explanation:

In project management, earliest finish time for activity A refers to the earliest start time for succeeding activities such as B and C to start.

Assume that activities A and B comes before C, the earliest finish time for C can be arrived at by computing the earliest start-finish (critical path) of the activity with the largest EF.

That is, if two activities (A and B) come before activity C, one can estimate how long it's going to take to complete activity C if ones knows how long activity B will take (being the activity with the largest earliest finish time).

Cheers!

7 0
3 years ago
What is CPU<br>and it's functions<br>​
BartSMP [9]

Answer:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer

5 0
2 years ago
Read 2 more answers
Other questions:
  • Overloading in methods are popular in programming, and why overloading is important.
    6·1 answer
  • Create an Entity-Relationship Diagram with the following requirements.
    6·1 answer
  • How do you uninstall sc update?
    13·2 answers
  • Describe the best way to deal with a difficult co-worker?
    13·2 answers
  • Is downloading like installing?
    13·1 answer
  • If a function doesn’t return a value, the word _________ will appear as its return type.
    6·1 answer
  • PLEASE I NEED HELP PLEASE PLEASE<br> Which function prompts the user to enter information?
    9·1 answer
  • HELP PLSSS I WILL MARK U!!!!
    10·2 answers
  • Which type of protocol allows for a secure data transmission using encryption methods?
    7·1 answer
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!