Question

java program: to solve as many linear equations as possible. using while loop, and 5 linear...

java program: to solve as many linear equations as possible. using while loop, and 5 linear equations
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:-

The below is the required source code for the given problem

Code:-

%%class definition
public class LinearEquation {
%%main method definition
    public static void main(String[] args) {
%%variables
        int x,y;
%%intiallization
        x=0;
%%printing the header
        System.out.println("X\tY");
%%finding the value of y based on x
        while(x<10){
%%calculating y value
            y=2*x+1;
%%showing the value
            System.out.println(x+"\t"+y);
%%incrementing the value of x
            x++;
        }
    }
}

If you find difficulty to understand the code, please let me know in comments tab below, Then I will provide another code or else i will any modifications in the present code. Hope it will helps you. Please give Thumbs Up!! Thank you for posting the question, All the best.

Add a comment
Know the answer?
Add Answer to:
java program: to solve as many linear equations as possible. using while loop, and 5 linear...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please write a java program that inputs positive numbers using a while loop until a negative...

    Please write a java program that inputs positive numbers using a while loop until a negative number is input and finds the sum of the numbers input

  • Write a program in Java that converts the following do-while loop block to: for loop Write,...

    Write a program in Java that converts the following do-while loop block to: for loop Write, compile and run below program segment. Make sure to click on the Output Window to input the number. Evaluate the program. Take notes and comment of below program segments of your observations. int x; Scanner input = new Scanner(System.in);       x = input.nextInt();       do{             System.out.printf(“%d\n”, x * 2);             x++;       } while(x < 100);

  • For this lab you will write a Java program using a loop that will play a...

    For this lab you will write a Java program using a loop that will play a simple Guess The Number game. Th gener e program will randomly loop where it prompt the user for a ate an integer between 1 and 200 (including both 1 and 200 as possible choices) and will enter a r has guessed the correct number, the program will end with a message indicating how many guesses it took to get the right answer and a...

  • Write a java program that makes use of the ‘DO WHILE ’ loop. The program asks...

    Write a java program that makes use of the ‘DO WHILE ’ loop. The program asks a user to enter information about several of their friends. The information is their last name, the state they live in, their age, and their expected graduation year. After you enter one friend, write out each individually. You must use JOptionPane to input the 4 fields, and to output the 4 fields. Refer to the textbook Code Listing 4-6 to see how to use...

  • FINAL (Continued 7. (12% ) Solve, if possible, the following system of linear equations using Cramer's...

    FINAL (Continued 7. (12% ) Solve, if possible, the following system of linear equations using Cramer's Rule 3z1 + -zs 7 +2r+3 3 2,+6 =-4 8. (15% ) Determine the characteristic polynomial, eigenvalues, and the corresponding eigenspaces. -2 Diagonalize (if poesible) the matrix A= Give the similarity transformation. -3 0 2 9 (15% ) Orthogonally diagonalize the symmetric matrix A Give the similarity transformation. FINAL (Continued 7. (12% ) Solve, if possible, the following system of linear equations using Cramer's...

  • Write Java code using a for loop that is equivalent to the following do-while loop: int...

    Write Java code using a for loop that is equivalent to the following do-while loop: int i = 2 ; do { System.out.println(i + " squared is " + (i * i)) ; i += 2 ; } while (i <= 10) ;

  • 5. Solve the linear program below as follows: First, solve the dual problem graphically. Then use...

    Operations Research 5. Solve the linear program below as follows: First, solve the dual problem graphically. Then use the solution to the dual problem to determine which variables in the primal problem are zero in the optimal primal solution. [Hint: Invoke complementary slackness.] Finally, solve for the optimal basic variables in the primal, using the primal equations. Primal Maximize-4x2 + 3x3 2x4-8xs, subject to: 3x1 + x2 + 2x3 +x4 = 3. x)2。 (j=1,2,3, 4.5). 5. Solve the linear program...

  • Use Cramer's Rule to solve (if possible) the system of linear equations. (If not possible, enter...

    Use Cramer's Rule to solve (if possible) the system of linear equations. (If not possible, enter IMPOSSIBLE.) 4x - 2y + 3z = -11 2x + 2y + 5z = 1 8x - 5y – 2z = 10 (x, y, z) = (I

  • Using java use a while loop use JOptionPane Scenario – You go to an arcade with...

    Using java use a while loop use JOptionPane Scenario – You go to an arcade with 100 tokens, and each game costs a variable number of tokens. Before the loop begins, display how many tokens you have available. Inside the loop, ask the user how many tokens does the next game cost, and subtract that amount from the total tokens if it is less than or equal to the total tokens. Then, state how many tokens are still left.

  • HELP IN JAVA: WHILE LOOP: Write a program that asks the user to enter a number...

    HELP IN JAVA: WHILE LOOP: Write a program that asks the user to enter a number of seconds. This number should be less than or equal to 32767 because that is the largest number pep8 can handle. Your program should then output the number of hours, minutes, and seconds on the planet of Crypton, where there are 64 seconds in a minute and 32 minutes in an hour.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT