Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

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

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.

  1. An algorithm is a procedure for solving a problem in terms of the actions to execute and the order in which these actions execute.
  2. A set of statements contained within a pair of parentheses is called a block.
  3. A selection statement specifies that an action is to be repeated while some condition remains true.
  4. A nested control statement appears in the body of another control statement.
  5. Java provides the arithmetic compound assignment operators +=, -=, *=, /= and %= for abbreviating assignment expressions.
  6. The primitive types (boolean, char, byte, short, int, long, float and double) are portable across only Windows platforms.
  7. Specifying the order in which statements (actions) execute in a program is called program control.
  8. The unary cast operator (double) creates a temporary integer copy of its operand.
  9. Instance variables of type boolean are given the value TRue by default.
  10. Pseudocode helps a programmer think out a program before attempting to write it in a programming language.

 

Write four different Java statements that each add 1 to integer variable x.


25.0C
77.0F
298.0K

this 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:

  • An explanation of each stage of development, including code and any test input and output.
  • The output of hypotenuse(3,4).
  • The output of two additional calls to hypotenuse with different arguments.

Write a single statement that prints outsideTemperature with 4 digits. End with newline. Sample output with input 103.45632:

103.5

What 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.


LATEST TUTORIALS
APPROVED BY CLIENTS