Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need some brief simple answers for these short problems. The following questions have been provided just to provide a guideline for demo-prep. The TAs may
Need some brief simple answers for these short problems.
The following questions have been provided just to provide a guideline for demo-prep. The TAs may ask you any quesiton related to this Assignment. 1. In Q1, how did you seperate the 4-digit number? Explain it. Modify the code for a 3-digit number. 2. If you find the average of a 3 integer numbers stored in three int type variables x,y and z, and print the result on the standard output with upto 3 decimal places, what would be the statement in Java to accomplish this task? 3. Write an equivalent java statement for the given mathematical equation. Assume that all the varaiables have been declared and assinged with appropriate values: y=3c(a2b5)7(a+b2.5)7.9 4. Although double type variable can store any real number (both whole and fractional numbers), why do we use int-type variable then? 5. Do we know what the following terms mean in Java: public, static, void. 6. What is main()? Do we need main() to execute a code in java? 7. What is the difference between constant-term and variable in Java? How do we declare a constant term in Java? 8. If we declare a constant term in java can we overwrite it's value once we have assigned a value to it in the first place. 9. How can you take out the most significant digit from a n-digit long integer number in your code? 10. How can you take out the least significant digit from a n-digit long integer number in your code? 11. Is there any difference between the follwing two expressions: double a=5/99.0+3; double b= 9.05/9+3; What is the rationale behind your answer? 12. Why do you need to write any comment in the code? 13. In the follwoing java statement, what to avoid any logical error, what would be variable type of the variable 'number'? double value = number /3; What is the rationale behind your answer? 14. What is the difference between these three assignment statements in java: x=1;x= ' 1 '; x= " 1 "; What is the data-type for x in each case? 15. Is the following declaration with initialziation is valid in Java? float number =2.5; What is your rationale behind your answer? 16. What modiers have been used to declare PI in the Math class? 17. In System.out.print () statement what is out? 18. In System.out.printf( ) statement what is printf()? 19. In any given code, how can you point out a method just by looking at it. 20. Assume that the naming conventions are strictly maitained, how can you point out the name of a class in a given code. 21. What will be the value of the following expression in java: 5%2; explain. 22. What will be the value of the following expression in java: (5%2); explain. 23. What will be the value of the following expression in java: (2%5); explain. 24 . What will be the value of the following expression in java: (2/ 5); explain. 25. What will be the value of the following expression in java: (5/4); explain. 26. In Q1 did you declare any reference variable? If so, how many and what are the names of those referencevariables you chose. 27. Declare a character type variable and assign any value to it. 28. Declare a String type reference-variable and assign any value to it.Declare a float type variable and assign any value to itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started