
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
![X G Morénike Giwa Onaiwu - Google X +
N=9781337274609&id=1568875638&snapshotld-30824288
Student Log In
gram file
lize this
cialize this
ar.
ecord your
NewAge.java
1 // This program calculates your age in the year 2050.
2 // Input: None.
3 // Output: Your current age followed by your age in 2050.
4
5 public class NewAge
6 {
7
8
9
+
10
11
12
13
14
15
16
17
18
19}
20
public static void main(String args[])
{
// Declare and nitialize your variables here.
}
newAge = current Age+ (2050 - current Year);
System.out.println("My Current Age is " + currentAge);
System.out.println("I will be " + newAge + " in 2050.");
System.exit(0);](https://content.bartleby.com/qna-images/question/fb159f4c-7231-4699-941e-0ff17cd91da8/dbb65ca9-3e71-47bb-a75c-f3c960812606/u5bv9u_thumbnail.jpeg)
Transcribed Image Text:X G Morénike Giwa Onaiwu - Google X +
N=9781337274609&id=1568875638&snapshotld-30824288
Student Log In
gram file
lize this
cialize this
ar.
ecord your
NewAge.java
1 // This program calculates your age in the year 2050.
2 // Input: None.
3 // Output: Your current age followed by your age in 2050.
4
5 public class NewAge
6 {
7
8
9
+
10
11
12
13
14
15
16
17
18
19}
20
public static void main(String args[])
{
// Declare and nitialize your variables here.
}
newAge = current Age+ (2050 - current Year);
System.out.println("My Current Age is " + currentAge);
System.out.println("I will be " + newAge + " in 2050.");
System.exit(0);

Transcribed Image Text:gage.com/static/nb/ui/evo/index.html?deploymentid=57453211095901691925913729&eISBN 978133727
CENGAGE MINDTAP
2.1-Declaring and Initializing Java Variables
Declaring and Initializing Java Variables
Summary
In this lab, you declare and initialize variables in a Java program. The program file
named NewAge.java, calculates your age in the year 2050.
Instructions
1. Declare an integer variable named newAge .
2. Declare and initialize an integer variable named currentAge . Initialize this
variable with your current age.
3. Declare and initialize an integer variable named current Year. Initialize this
variable with the value of the current year. Use four digits for the
4. Execute the program.
year.
1
14
16
17
18
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Python programmingarrow_forwardPlease explain why you think interfaces are preferable than abstract classes.arrow_forwardc/ c++ / Java / python - anything you like please give me witihn few minutes Im trying to write a program in python to find the smallest divisor of an integer.Take integer from userarrow_forward
- vi) In C# programming language, create a program to take input three integers x, y, and z and print their product in the output.arrow_forwardProgram Unit Score Calculator Console App Write a Python Console Application program that allows the user to enter the marks for different assessments in a unit, and computes the total mark and grade for the unit. Here is the program logic specification: There are six assessment activities Quiz1, Quiz2, Quiz3, Quiz4, Lab Journal, Major Assignment and Final Exam. The four quizzes are worth 5 marks each, the Lab Journal is worth 10 marks, the Major Assignment is worth 30 marks and the Final Exam is worth 40 marks. The algorithm for computing the total mark for the unit is: Total Mark = Quiz1+Quiz2+Quiz3+Quiz4+Major Assignment+ Lab Journal + Final Exam The following screenshot shows a successful test run:arrow_forwardin python “c” represents a crop and “w” represents a water source. Each water source hydrates the eight tiles around it (including itself) Input the number of rows and columns in the crop field:ROWS> 4COLUMNS> 4Input each row of the crop field.ROW0> c c c wROW1> w c c cROW2> c c c cROW3> c w c cNot all crops are watered!OUTPUT FalseThe following crops are not watered:OUTPUT [(2, 3), (3, 3)] Input the number of rows and columns in the crop field:ROWS> 7COLUMNS> 1Input each row of the crop field.ROW0> cROW1> wROW2> cROW3> cROW4> wROW5> cROW6> wAll crops are watered!OUTPUT Truearrow_forward
- Use the following: basic input and output, expressions, variables, and assignments, the math and random libraries, expressions, variables, and assignments; mathematical calculations that do not require the use of a library, Other Python statements cannot be used, e.g. defarrow_forwardfinish code in python No hand written and fast answer with explanationarrow_forwardOne of the benefits of computers is that they can be programmed to do a specific task. Which of the following statements is correct?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education