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

Number Guessing Game


In the number guessing game, the computer will randomly

select a number from a range of numbers e.g. 1-100 and then the game

will give the player five attempts to guess the number.


Gameplay:

If the player’s guess is higher than the chosen number, the

program will tell the player to try another LOWER than the

previous guess.


If the player’s guess is lower than the chosen number, the

program will tell the player to try another number HIGHER than

the previous guess.


If the player guesses the number before he consumes the five

attempts, then display congratulatory message.


I need the code to have an output stated above.


In the game Rock Paper Scissors, two players simultaneously choose one of the three options: rock, paper, scissors. If both player choose the same option, then the result is a tie. However, if they choose differently, the winner is determined as follows:


• Rock beats scissors, because a rock can break a pair of scissors

• Scissors beats paper, because scissors can cut paper

• Paper beats rock, because a piece of paper can cover a rock


Create a Python script in which a computer randomly choose

rock, paper or scissors. Let the user enter a number 1, 2, or 3 each

representing one of the three choices. Then, determine the winner.


I need the code to have an output stated above.


Create a Python script that will generate random n integers from a given start and end of a range.


I need the code to have an output stated below:


Value for n : 5

Value for start : 1

Value for end : 10

10 8 7 8 3


Write a for loop to print the numbers from 20 to 30, inclusive (this means it should include both the 20 and 30). The output should all be written out on the same line.



You decide to buy some stocks for a certain price and then sell them at another

price. Write a program that determines whether or not the transaction was

profitable.

• Take 3 separate inputs: the # of shares, the purchase

price of the stocks, and the sale price, in that order.

• You purchase the # of stocks determined by the input.

• When you purchase the stocks, you pay the price determined by the input.

• You pay your stockbroker a commission of 3% on the amount paid for

the stocks.

• Later, you sell the all of the stocks for the price determined by the input.

• You pay your stockbroker another commission of 3% on the amount

you received for the stock.


Your program should calculate your net gain or loss during this transaction and

print it in the following format:


If your transaction was profitable (or if there was a net gain/loss of 0) print:

"After the transaction, you made 300 dollars."


If your transaction was not profitable, print:

"After the transaction, you lost 300 dollars."



Machine Problem 1



Number Guessing Game



In the number guessing game, the computer will randomly select a number from a range of numbers e.g. 1-100 and then the game will give the player five attempts to guess the number.



Gameplay:



• If the player's guess is higher than the chosen number, the program will tell the player to try another LOWER than the previous guess.



• If the player's guess is lower than the chosen number, the program will tell the player to try another number HIGHER than the previous guess.



■ If the player guesses the number before he consumes the five attempts, then display congratulatory message.

Machine problem 3



In the game Rock Paper Scissors, two players simultaneously choose one of the three options: rock, paper, scissors. If both player choose the same option, then the result is a tie. However, if they choose differently, the winner is determined as follows:



• Rock beats scissors, because a rock can break a pair of scissors



• Scissors beats paper, because scissors can cut paper



• Paper beats rock, because a piece of paper can cover a rock



Create a Python script in which a computer randomly choose rock, paper or scissors. Let the user enter a number 1, 2, or 3 each representing one of the three choices. Then, determine the winner.

why using num variable please explain


Ramsha’s basic salary is input through the kevboard. His medical allowance is 40% of basic salary And house rent allowance is 20% of basic salary, Write a program to calculate his gross salary:


Consider the table below and answer questions 23 to 25. The table depicts the running time (seconds) dependant on input size (n) of three algorithms Algorithm n = 100 n = 1000 n = 10 000 A 4 400 40 000 B 9 90 900 C 21 31 41 Question 23 What is the running time complexity of algorithm A? 1. O(n) 3. O(log n) 2. O(n2 ) 4. O(2n ) Question 24 What is the running time complexity of algorithm B? 1. O(n) 3. O(log n) 2. O(n2 ) 4. O(2n ) Question 25 What is the running time complexity of algorithm C? 1. O(1) 3. O(log n) 2. O(n) 4. O(1/n


LATEST TUTORIALS
APPROVED BY CLIENTS