Do in C++ programming A game to collecting coins. In level # 1, whenever the player takes a coin, the next coin is automatically blocked with an iron brick. Which coins should
Q: k= factorial (6) k=: * O 150 O 270 O 720 O 120 O Other:
A: Your answer is given below as you required with an output.
Q: Examining supervised learning in relation to unsupervised learning within the framework of neural…
A: The algorithm is trained on a labelled date set in a supervised learning model, which acts as an…
Q: Create a Java program that asks the user to enter three (3) first names then display the following:…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: For a problem we have come up with three algorithms: A, B, and C. Running time of Algorithm A is…
A: Answer in step 2
Q: Examining supervised learning in relation to unsupervised learning within the framework of neural…
A: The algorithm is trained on a labeled dataset in a supervised learning model, which acts as an…
Q: A GSM system uses 124 channels and each channel is divided into 8 time slots. What is the maximum…
A: The answer is
Q: e CPU is and what it doe
A: Solution - In the given question, we have to explain what the CPU is and what it does.
Q: The number of nodes in the longest path from the root node to a leaf node is called: (A) Depth B)…
A: Depth: Total number of nodes from the root to the farthermost leaf node. Width: Maximum number of…
Q: The function reshape (A,r,c) is used to: O reshapes A in to r column and c rows O reshapes A in to r…
A: In MATLAB and Python, the reshape function is used to rearrange the contents of a matrix into a…
Q: A 3 8 00 F 3 D 5 сл 3 3 G 1 E 3 B 3 C 5. -For the given graph, perform Dijkstra algorithm for…
A: In the given graph, it contains 7 vertices that are {A, B, C, D, E, F, G} and between these vertices…
Q: What are some of the reasons why watchdog timers are required in many embedded systems?
A: A watchdog timer (WDT) is a component of the most straightforward sort of embedded system, and it is…
Q: Failover-Clustering
A: Solution - In the given question, we have to tell what is Failover Clustering and why it is widely…
Q: When it comes to employing several threads vs. many processes, why should one be preferred over the…
A: This question comes from Operating System which is a paper of Computer Science. Let's discuss it in…
Q: This is software engineering question Iterator - Description - how it works - Under what…
A: According to Bartleby guidelines we are supposed to answer only 3 subparts of a question, since i…
Q: a) Serially shifting a byte of data into a shift register. b) Parallel loading a byte of data into a…
A: A) A byte is is the size of 8 bits so the serially shifting a byte of data take 8 clock pulses. B)…
Q: Finally, what is the ultimate purpose of artificial intelligence? Please provide a list of the major…
A: Create the AI's goals: Academics in the past created algorithms that imitated humans' step-by-step…
Q: Acquaint yourself with the many forms that computers may take and the tasks that each one is best…
A: Computers are becoming an increasingly essential component of our daily life.Currently, everything…
Q: Q2-Write a java program that has a method called stringDay to display the string named Day based on…
A: here in the question ask about java program that has a method called stringDay to display the string…
Q: Explain the difference between packet switching and circuit switching using an example. switching
A: We will examine the distinction between packet switching and circuit switching.
Q: (Java begner Tutorial) Question 3 Provide statement with appropriate built-in method and arguments…
A: As per the requirement program with explanation is provided. Algorithm: Step 1: iv bit.. Write the…
Q: Consider the following code. Replace the tags _??1_ and _??2_, respectively, by filling in the text…
A: _??1_= ',' So the statement becomes: interface myInterface extends A,B{ } _??2_=trim interface…
Q: How many 10-bit strings begin with "101" or "00"?
A: In the above question we have to find the number of 10 bit strings begin with 101 or 01are possible
Q: What is a full binary tree? A Each node has exactly one or two children (B) Each node has exactly…
A: Answer in step 2
Q: 7. Simplify the following expressions by applying Karnaugh maps F= A'B'D + A 'BC + A B D + A B' C'…
A: Find your answer below
Q: - The step function u (t) is integral of * with respect to time t. O Sinusoidal function O Ramp…
A: ANSWER:
Q: Discussions: 1) From your results of item four, state all the functions of IC 7490 decade counter.…
A: IC 7490 is Asynchronous mod-10 Counter IC. In this text, we're going to have a look at IC 7490…
Q: h statement about subtypes is false? Set is a subtype of Set Set is a subtype of Set Set is a…
A: Lets see the solution.
Q: Is it accurate to say that a computer is a piece of technology that is made up of a number of…
A: Computer: The storing and retrieval of data are fundamental tasks of the modern computer. Computer…
Q: When compared to random access memory (RAM), how does virtual memory do in terms of its processing…
A: In this question we have to compare Random Access Memory with Virtual Memory in terms of processing…
Q: Describe the many different kinds of computer apps and the qualities that they each have.
A: Different Categories of Computer Programs: We can categorize computer programs as well as computer…
Q: How would you characterize the process of supervised learning in neural networks from a mathematical…
A: Neural networks refer to systems of neurons , either organic or artificial in nature.
Q: ences between computer architecture and co
A: Introduction: Below the key differences between computer architecture and computer organization.
Q: With the use of auxiliary variable, what number exceeds its square by the maximum amount?
A: Let the number be X and the difference be D. Now, D = x-x2 = -x2+x = -[x2-x] = -…
Q: When a CPU issues an interrupt, the processor is forced to pause whatever it is working on so that…
A: Interrupts are a unique response generated by applications that require immediate CPU attention.The…
Q: If z=[7 8 9 3 4], then length(z)= *
A: In Step 2, I have provided answer with brief explanation----------- For more understanding , I…
Q: Why is it that the most recent generation of computers are capable of executing instructions both…
A: Recent Generation of Computers: Instructions in computers of the most recent generation may be…
Q: Answer The following a. Write the statement to declare an integer array alpha of size 95. b.…
A: a) We declare the array alpha of size 95 of type integer int alpha [95]; b) We initialize the array…
Q: Can this by done using Code C and must include clear comments as well please?! The exercise is…
A: According to the information given:- We have to follow the instruction to implement the scores of…
Q: Which fibre is utilised to protect the inner core and prevent the cable from straining in…
A: The development of fiber optic links, which are one of the least complex yet most incredible assets…
Q: Alice and Bob use the ElGamal scheme with a common prime q=131 and a primitive root a = 6. Let Bob's…
A: The answer is
Q: a) What does "System Call" stand for? How exactly does the operating system deal with it?
A: A system call or Syscall is a mechanism that provides the interface between a process and the…
Q: Provide a mathematical explanation of the steps involved in supervised learning in neural networks…
A: Artificial Neural Networks: There are two kinds of machine learning algorithms that are applied in…
Q: Using the DeMorgan's theorems, simplify the following expressions (i.e., simplify the following…
A:
Q: what is the SDLC?
A: Auditing is a gathering of information and evaluation of evidence as to report on the degree of…
Q: Is it true that the processing of information in neural networks takes place in a sequential fashion
A: Is it true that the processing of information in neural networks takes place in a sequential…
Q: 4. Refer to the given program. Draw a diagram to represent the following stack operations,…
A: Methods used: push() : It is used to insert into the stack. pop(): It is used to remove from the…
Q: Network Security Design is required since servers on a flat network are responsible for most of the…
A: Given: Demilitarized zones (DMZs), which give a level of network separation, keep internal corporate…
Q: What are some of the most common CLI troubleshooting commands that may be used to diagnose and fix…
A: The solution to the given question is: Today , most network applications have been updated many…
Q: Talk about when and how to use threads and processes in the context of each other.
A: The Thread and the method are contrasted and compared.A thread is a subset of a process, whereas a…
Q: What are the different functional activities that a microprocessor may perform?
A: Answer to the given question Different functional activities performed by microprocessor The…
Do in C++ programming
A game to collecting coins. In level # 1, whenever the player takes a coin, the next coin is automatically blocked with an iron brick. Which coins should the player take in order to maximize his gains?
EXAMPLE:
COINS IN ORDER 3$ 9$ 2$ 7$ 3$ 6$ 9$ 1$
START COLLECTING COINS = (SKIP 3$) (TAKE 9$) (AUTOMATICALLY BLOCKED 2$) (TAKE 7$) (AUTOMATICALLY BLOCKED 3$) (SKIP 6$) (TAKE 9$) (AUTOMATICALLY BLOCKED 1$) = TOTAL COINS WILL BE 25$ (max coins)
In level # 2, the same rules of level 1 apply, but with a twist:
the player have a bag that can take only a limited number of coins. Which coins can the player take in order to maximize his gains (provided that the coins fit inside his bag)?
Implement the following function for level# 2 using C++:
unsigned max_coins(
Step by step
Solved in 2 steps
- Do in C++ programming Super Mario is on the run collecting coins. In level # 1, whenever he takes a coin, the next coin is automatically blocked with an iron brick. Which coins should Mario take in order to maximize his gains?(see image) In level # 2, the same rules of level 1 apply, but with a twist: Mario has a bag that can take only a limited number of coins. Which coins can Mario take in order to maximize his gains (provided that the coins fit inside his bag)? Implement the following function for level# 2 using C++: unsigned max_coins(vector<unsigned> coins, unsigned capacity)Write a program using c++that plays a dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get as close to 21 as possible without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player Loop: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is…Write a c++ program for a bank in your town that updates its customers’ accounts at the end of each month. The bank offers two types of accounts:savings and cheque. Every customer must maintain a minimum balance.Minimum balances for the accounts are: Savings : R 1000.00 Cheque: R 1500.00If a customer’s balance falls below the minimum balance, there is a service charge of R50.00 for savings accounts andR100.00 for cheque accounts. If the balance at the end of the month is at least the minimum balance, the clientreceives interest as follows: Savings accounts receive 4% interest on the balance. Cheque accounts with balances of up to R 5000.00 more than the minimum balance receive 3% interest;otherwise, accounts with balances more than R 5000.00 more than the minimum balance receive 5% interest.Write a c++ program that requests the user to enter a customer’s account number (int type), account type (char type - S for savings, C for checking) and current balance. The updated balance must…
- C++ Write a program that simulates the minute-by-minute operation of a checkout line, such as one you might find in a retail store. Use the following parameters: Customers arrive at the checkout line and stand in line until the cashier is free. When they reach the front of the line, they occupy the cashier for some period of time (referred to as ServiceTime) measured in minutes. After the cashier is free, the next customer is served immediately. Customers arrive at the checkout line at ArrivalRate per minute. Use the function included below (customerArrived()) to return the number of customers arriving in a given minute, determined randomly. The line can only hold so many people, MaxLineSize, until new arriving customers get frustrated and leave the store without purchasing anything. The overall time of the simulation is SimulationTime, measured in minutes. The program should take 5 inputs (to be read from a text file named simtest.txt, one per line): SimulationName - a string…write a c program Count Dracula buys blood from the public. But since he prefers certain types to others, he pays as follows: Type Rate/liter A P 3000.00 B P 1800.75 C (for AB) P 2880.25 O P 1500.00 Write a C program to input a client’s blood type and the volume (liter) of blood extracted. Output how much the client will be paid.In Java - A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400; therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Default code: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int inputYear; boolean isLeapYear; isLeapYear = false; inputYear = scnr.nextInt(); /* Type your code here. */ }}
- Illustrate your knowledge of C-Programming by implementing a ‘Game of Dice’.User will start with 3 lives and 100 initial points. Program will ask the user to rollthree dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user willget -10 points. If sum is 3, user will lose one life.For every increase of 50 points, user will get one new life and for every decrease of50 points, user will lose one life. If at any point, user has 200 or more points,program will display message, ‘Congratulations, You Win!!!’ and end. If user haszero lives or zero points, program will display the message ‘Game Over. Sorry, YouLose.’ and end.Program will use the following user defined functions to implement the gameFunction ‘DisplayGameRules()’ will display the following message on screen.############################################## ROLL the DICE GAME…using a C++ program code the problem, The game of "23" is a two-player game that begins with a pile of 23 toothpicks. Players take turns, withdrawing either 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game. Write a human vs. computer program that plays "23". The human should always move first. When it is the computer's turn it should play according to the following rules: If there are more than 7 toothpicks left, then the computer should withdraw a random number of toothpicks (from 1 to 3). Use the rand() function, as demonstrated in class to produce this number.. If there are 2, 3 or 4 toothpicks left, then the computer should withdraw enough toothpicks to leave 1. If there is 1 toothpick left, then the computer has to take it and loses. When the human player enters the number of toothpicks to withdraw, the program should perform input validation. Make sure that the entered number is between 1 and 3 (inclusive) and that the player is…Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }
- Write a C/C++ program that asks the user for threeinteger marks. These are the student marks out of25 for class tests.Subsequently the program should ask the user fora big test mark out of 50. The final mark iscalculated with 50% class tests and 50% test mark.Test all values for validity. If a value is invalid, amessage should be displayed, and the user shouldbe repeatedly given chance to correct the input.The program should display the final mark, as wellas the symbol of the student (see Table 1.2).The program should repeat until the user enters“-1” for the first class test.After the user has entered “-1”, the program shoulddisplay a summary of the marks, i.e. the averagefinal mark, highest final mark, and lowest finalmark. The program also displays the number ofstudents that pass (mark>=50), pass withdistinction (mark>=75), and the number of studentsthat fail (mark<50).See Figure 1.2 for example outputUse Java Implement a game of Pig where the user plays against a "hold at 20 or goal" computer player that rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20, or the score plus the turn total is greater than or equal to 100. The first player is chosen randomly. An empty input (i.e., Enter) indicates that the user wishes to roll. Any entered line of non-zero length indicates that the user wishes to hold. Before the game, randomly select which player the user will be, and print the line "You will be player #.", where # is the user's player number. Then, print an instruction line "Enter nothing to roll; enter anything to hold." Before each turn, print a line with "Player 1 score: " and player 1's score. Print another line with "Player 2 score: " and player 2's score. Finally, print a line with "It is player #'s turn.", where "#" is replaced by the current player number. Play starts with player 1 and then alternates. For each roll, print a line with…Write a console application in c++ that prints the next 20 leap years. A leap year is a year in which an extra day is added to the Gregorian calendar, which is used by most of the world. While an ordinary year has 365 days, a leap year has 366 days. ... A leap year comes once every four years. Because of this, a leap year can always be evenly divided by four.