Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Q-3


Single File Programming Question


Your little brother has a math assignment to find whether the given u power of 2. If it is a power of 2 then he has to find the sum of the digit power of 2, then he has to find the next number which is a power of your help to validate his work. But you are already busy playing video games Develop a program so that your brother can validate his work by


Example 1


Input


64


Output


Single File Programming Question

Ram and Mohan are two brothers. They are not good at maths. So their father decided to give some assignments as a game so that they can enjoy as well as they can learn the concept of number systems. So he gave two numbers to them. One is the sum of two numbers, x and y, and another is the product of the same two numbers. Help them to write a code to find x and y.

Note:

The two numbers should be printed in ascending order.

Example 1

Input

56

Output

23

Explanation

If we sum the numbers 2 and 3 we get the first input value 5 and if we

java.util. G

Scanner(

sum

prod

( i

Il virtusacoetraining.examly.io is sharing your scre

This question has been answered by someone else before but was not complete so kindly this time answer this in full and also when you write classes do send the code as well with the answer.

Question:

You will be tasked to write this program in Java.

The goal is for the program to be able to guess the user's political party before they reach the end of the survey. This will require your program to gather a substantial amount of data before it can make accurate guesses. In particular:

TASK:

The last question should ask which political party they affiliate with. This way you will be able to gather and store data corresponding to the results you acquire. Create at least 4 political party storage.


This question has been answered by someone else before but was not complete so kindly this time answer this in full and also when you write classes do send the code as well with the answer.

Question:

You will be tasked to write this program in Java.

The goal is for the program to be able to guess the user's political party before they reach the end of the survey. This will require your program to gather a substantial amount of data before it can make accurate guesses. In particular:

2. The last question should ask which political party they affiliate with. This way you will be able to gather and store data corresponding to the results you acquire. Create at least 4 political party storage.


The Double. parseDouble() method requires a String argument, but it fails if the String cannot

be converted to a floating-point number. Write an application in which you try accepting a

double input from a user and catch a NumberFormatException if one is thrown. The catch

block forces the number to 0 and displays an appropriate error message. Following the catch

block, display the number. Save the file as TryToParseDouble.java

code in java

Ram and Mohan are two brothers. They are not good at maths. So their father decided to give some assignments as a game so that they can enjoy as well as they can learn the concept of number systems. So he gave two numbers to them. One is the sum of two numbers, x and y, and another is the product of the same two numbers. Help them to write a code to find x and y.

Note:

The two numbers should be printed in ascending order.
Input

56

Output

23

Explanation

If we sum the numbers 2 and 3 we get the first input value 5 and if we multiply 2 and 3 we get the second input value 6. Hence the output is 2 and 3

Example 2

Input

15 50

Output

5 10

code in Java

NOTE:

This question has been answered by someone else before but was not complete so kindly this time answer this in full and also when you write classes do send the code as well with the answer.

You will be tasked to write this program in Java,

The goal is for the program to be able to guess the user's political party before they reach the end of the survey. This will require your program to gather a substantial amount of data before it can make accurate guesses. In particular:

1. You should begin by presenting the user with questions that contain answer options that dier based on their political beliefs.

Ex. What should the government do to help the poor?

A. Make it easier to apply for assistance. B. Put more money into schools.

C. Incentivize welfare.

D. Nothing.


Design a program using Java NetBeans (Console application). With the following enum class: public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } Create a second class called enumDayMood with a void method call telDayMood (). This method contain a switch case as follows: switch (day) { case MONDAY: JOptionPane.showMessageDialog (frame, "Mondays are bad."); break; case FRIDAY: JOptionPane.showMessageDialog (frame, "Fridays are better."); break; case SATURDAY: case SUNDAY: JOptionPane.showMessageDialog (frame, "Weekends are best."); break; default: JOptionPane.showMessageDialog (frame, “Midweek days are so-so."); break; } Create a method that will ask the user to enter a day of a week and the program should tell the mood of the day. If the user enter a wrong value the program should exit with 0.


You will be tasked to write this program in either C++ or Java, whichever you feel more comfortable with.

The goal is for the program to be able to guess the user's political party before they reach the end of the survey. This will require your program to gather a substantial amount of data before it can make accurate guesses. In particular:

2. The last question should ask which political party they affiliate with. This way you will be able to gather and store data corresponding to the results you acquire. Create at least 4 political party storage.



Design a program using Java NetBeans (Console application). With the following enum class: public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } Create a second class called enumDayMood with a void method call telDayMood (). This method contain a switch case as follows


LATEST TUTORIALS
APPROVED BY CLIENTS