Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
7.5k views
in Information Technology by (71.3k points)

I. Help Manish in identifying the incorrect variable name with justification from the following:

i. unit@price; 

ii. fee; 

iii. userid; 

iv. avg marks;

II. Write Java code to declare a variable named Price of integer type. Assign a value 10 to this variable. Overwrite the value of price with its double value. Decrease the value of price by 5.

1 Answer

+2 votes
by (76.5k points)
selected by
 
Best answer

I. (i) unit@price; // Special symbols like "@" is not allowed in variable name

(iv) avg marks;// Spaces are not allowed in variable name

II.

int price;

price=10;

price=price*2;

price=price-5;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...