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

 A single-player plays the game with the computer. The deck is composed of 16 cards: ● 3 black 1's, 2 black 2's, 2 black 3's and 1 black 4 ● 3 white 1's, 2 white 2's, 2 white 3's and 1 white 4 The aim is to stack the cards one by one in sorted order in the stack (blacks from 1 to 4 and whites from 1 to 4). Game Rules: Starting the game: ● The deck is shuffled and three cards are dealt with each player. ● Players can only see their partner's hand. They can not see their own hands. ● In the beginning, players have a total number of 3 tips. ● In the beginning, players have a total number of 2 lives. ● The stack is empty. ● The trash is empty. Playing the game: ● Game is played in turns. In each turn, a player selects one of the following moves: ○ Give tip: Player spends a tip (if there is any) and gives some information to his/her partner about his/her cards: ■ The tip can only be about the colour or the value of the cards. For example, you can not say a card is a black 2. You can either say it is black or it is 2. ■ The tip has to include the location of all cards which have the same value or the same colour. For example, if your partner's hand is “black 1, white 1, white 3”, you can not say the first card is 1 or the second card is white. You have to say the first and second cards are 1 or second and third cards are white. ○ Stack card: Player picks one of his/her own cards to place in the stack and draws a new card from the deck (if there is any). ■ If the card can be stacked, it is added in the stack. ■ Otherwise, the card is added to the trash and a life is lost. ○ Discard a card: Player picks one of his/her own cards to place in the trash and draws a new card from the deck (if there is any). One tip is earned. The game ends when: ● no lives left (zero), or ● no cards left to play, or ● the stack has all 8 cards ● The final score is the total number of cards in the stack. Obviously, the maximum possible score is 8.


write code using the range function to add up the series 20, 30, 40,...90


Write a program to output the following

^ ^

( o o )

v


Consider the following function mys.

def mys ( ):

If m == 1:

return (1)

else :

return (m*mys(m - 1) )

Which of the following is correct ?

1. The function always terminates with

mys(n) = factorial of n

2. The function always terminates with

mys (n) = 1+2+...+n

3. The function terminates for non negative n with mys (n) = factorial of n

4. The function for positive n with mys(n)= factorial of n










For what value of n would g(57,n) return 7?

def g (m,n):

res = 0

while m >= n :

res = res + 1

m = m - n

return (res)



Function travelCharge(char,int,int): this function will calculate and return the traveling

cost based on the given table.


Vacation Places Places ID Adult (RM) Children (RM)

Pangkor Island P 350 175

Bukit Merah B 200 100

Teluk Batik T 80 40


A machine purchased for RM28,000 is depreciated at a rate of RM4,000 a year for 7 years.

Write and run a C++ program that computes and displays a depreciation table for 7 years.


Question:

Switching to a two-stage pipeline means introducing and extra stage meaning halving the executing rate, but instead it is doubled in some cases. Explain why?


Question:

Each instruction must contain the information required by the processor for execution.

a.     Discuss the elements of this required information.

b.     Discuss the main areas to which source and result operands belong.   


Question Link: https://ibb.co/bgzhbBW


LATEST TUTORIALS
APPROVED BY CLIENTS