It is late at night, and you decide to get a glass of milk before bed. Try to write
pseudocode describing the process of going to the kitchen and getting the milk. Be
very specific and make sure you have all actions in the correct sequence. For example,
remember you must open the refrigerator door before you reach in to retrieve the milk
container. What if there is no glass in the cupboard? Did you check whether the glass
was right side up before you started pouring? Now consider how many small
decisions you make every day, and consider how involved it would be to write a
program to instruct a robot to do the things you do in a day!
Polynomial
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
Input
The first line contains a single integer N.
Next N lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes coefficient of Pi.
Output
Print the polynomial in the format Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0, where Pi's are powers in decreasing order, Ci is coefficient, and C0 is constant. There will be space before and after the plus or minus sign.
If the coefficient is zero, then don't print the term.
If the term with the highest degree is negative, the term should represent -Cix^Pi.
For the term where power is 1, represent it as C1x instead of C1x^1.
If the polynomial degree is zero and the constant term is also zero, then print 0 to represent the polynomial.
For term Cix^Pi, if the coefficient of the term Ci is 1, print x^Pi instead of 1x^Pi.
Explanation
If N = 4
For power 0, the coefficient is 5
For power 1, the coefficient is 0
For power 2, the coefficient is 10
For power 3, the coefficient is 6.
Then polynomial represents "6x^3 + 10x^2 + 5"
Constraints
N <= 100
0 <= Pi < 1000
-1000 <= Ci <= 1000
State whether each of the following is true or false. If false, explain why.
Write four different Java statements that each add 1 to integer variable x.
25.0C
77.0F
298.0Kthis is expecetd output and when i enterded 37.5F iam getting value error
ValueError: invalid literal for int() with base 10: '37.5
Section 6.2 of your textbook describes incremental development. Do the exercise at the end of that section:
As an exercise, use incremental development to write a function called hypotenuse that returns the length of the hypotenuse of a right triangle given the lengths of the other two legs as arguments. Record each stage of the development process as you go. (Downey, 2015)
After the final stage of development, print the output of hypotenuse(3, 4) and two other calls to hypotenuse with different arguments.
Include all of the following in your Learning Journal:
Write a single statement that prints outsideTemperature with 4 digits. End with newline. Sample output with input 103.45632:
103.5What is programming
Tic-Tac-Toe game
Abhinav and Anjali are playing the Tic-Tac-Toe game. Tic-Tac-Toe is a game played on a grid that's three squares by three squares. Abhinav is O, and Anjali is X. Players take turns putting their marks in empty squares. The first player to get 3 of her marks in a diagonal or horizontal, or vertical row is the winner. When all nine squares are complete, the game is over. If no player has three marks in a row, the game ends in a tie. Write a program to decide the winner in the Tic-Tac-Toe game.
Input
The input will be three lines contain O's and X's separated by space.
Output
The output should be a single line containing either "Abhinav Wins" or "Anjali Wins" or "Tie".
Explanation
For example, if the input is
O X O
O X X
O O X
as three of O's are in vertical row print "Abhinav Wins".
Sample Input 1
O X O
O X X
O O X
Sample Output 1
Abhinav Wins
Sample Input 2
O O X
X X O
X O O
Sample Output 2
Anjali Wins
As a system analyst, Design a communication model that will be used to deploy a wan for your firm.., using ABCD as the branches
Explain four (4) reasons why its necessary to use methods in your Java programs.