Write a C++ program that lets the user guess whether a randomly generated integer would be even or odd. The program randomly generates an inte- ger and divides it by 2. The integer is even if the remainder is 0, otherwise odd. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.
Q: Computer science Short answer What is an input file?
A: Introduction: Files serve as a storage location for data that can be saved and retrieved.When a…
Q: It's important to know what makes up an information system's core components. What is the difference…
A: Introduction: When it comes to information systems, they are a collection of interconnected…
Q: Write an expression using either random or randrange to calculate the following: a) A random int in…
A: The Answer is
Q: Do you believe that the graph isomerphism problem belongs in the P class? Why, if this is the case?…
A: Isomorphism between two graphs It is said that two graphs are isomorphic when they contain the same…
Q: How is an embedded computer different from a general purpose computer?
A: Embedded computers are built to perform a particular function: General-purpose computers are…
Q: As a general rule, computer viruses are harmful software programmes that are difficult to detect and…
A: Introduction Malware or code that self-replicates by controlling other applications on an infected…
Q: Give an example of a scenario or setting in which it would be appropriate to include a hyperlink to…
A: You can add a hyperlink to an existing or new file, a web page, or an e-mail address with Excel 2016…
Q: Computer science What is the purpose of clustering data in a file?
A: Introduction: What is the purpose of clustering data in a file?
Q: Explain the Web analytics maturity model and some of its uses.
A: Introduction: A web analytics maturity model is a tool that uses people to assess the current…
Q: hat does it mean to be asynchronous?
A: Introduction: Asynchronous events occur at a different time than synchronous events, which occur at…
Q: Our business solution, which will provide us with actionable business insights, will be evaluated…
A: Intro Evaluate your business model to ensure that the current model will support your plans for…
Q: What are some of the most often used CLI troubleshooting commands for diagnosing and resolving…
A: Introduction: At times, time outs, lengthy buffering, and poor quality online calls are all typical…
Q: What part of the computer is responsible for programme execution?
A: Introduction: The Central Processing Unit (CPU) is the component or section of the computer that…
Q: What exactly is the purpose of a coaxial cable?
A: Introduction: The purpose of a coaxial cable:
Q: Computer science Explain why an index is useful only if there is sufficient variety in the values of…
A: Introduction: Basically ,Indexes are special lookup tables that can be used by the database search…
Q: Describe the several technologies that allow users to communicate large amounts of data across any…
A: The second section will discuss data communications networks, which are often composed of a…
Q: What happens if a process attempts to visit a page that hasn't been cached? What are the phases in…
A: Goal: To talk about what occurs if the process attempts to access a page that hasn't been saved in…
Q: What can a system designer do to keep the user's memory load to a minimum? There are further reasons…
A: An expert assessment uses his/her expertise and experience with websites that test users to visit a…
Q: Assume a user creates a new relation r1 with a foreign key that links to another relation r2. What…
A: Introduction: A FOREIGN KEY is like a field (or set of fields) in one database that refers to the…
Q: Define the concept of pointer arithmetic.
A: Introduction: Arithmetic with a pointer:
Q: Make a list of all you know about 'Creating Variables.'
A: Answer: 'Creating Variables' A dynamic construct is also called a dynamic construct in a C system.…
Q: What is the Extended Form of MBCS in Computer Science
A: Introduction What is the Extended Form of MBCS in Computer Science?
Q: A switch can be set up to monitor traffic via it, so describe how this may be done.
A: Introduction: The Data Link layer, sometimes known as Layer 2, of the OSI model is where network…
Q: What exactly is the CIA?
A: Intro CIA in Computer science stands for confidentiality, integrity and availability The CIA…
Q: MAC-based message integrity schemes vu nonce to delete this if that is the case? Vul
A: HMAC represents Hash based Message Authentication Code and this HMAC based message uprightness plot…
Q: What is debugging, and how does it work?
A: Debugging: For ensure client satisfaction overall application quality, every software…
Q: What does the phrase "debugging" refer to?
A: Introduction: Debugging: Debugging is the process of identifying and removing defects in software…
Q: Is there a problem with web applications?
A: A Web application - (Web app) is an application program kept on a distant server and distributed via…
Q: What is the difference in speed and cost between primary and secondary storage?
A: Introduction: The primary storage device collects data from a secondary storage device in order to…
Q: Plaintext is encrypted in binary form in current cryptography. Each bit in a bit stream is encrypted…
A: Symmetric key code is the stream cipher in which plaintext digits are combined with a pseudorandom…
Q: While the message is in transit, what happens if an attacker tries to modify the Tag (the MAC) and…
A: Presentation: While MAC characteristics and cryptographic hash features are similar, the security…
Q: In what situations can the Arrays.binarySearch and Collections.binarySearch methods be successfully…
A: Introduction: The Arrays.binarySearch and Collections.binarySearch methods can be used successfully…
Q: Discuss metrics in your own terms to improve network quality?
A: Introduction: In order to evaluate or improve the performance of your network, you can use numerous…
Q: Are HMAC-based message integrity schemes vulnerable to replay attacks? Is it possible to use a nonce…
A: When an insecure key exchange system is used to share hidden keys, the message integrity scheme…
Q: System software is defined as what? Also, explain the many forms of system software.
A: Introduction: System software is a type of computer programme that is meant to run in conjunction…
Q: Lexical analyzers may be designed in a variety of different ways. Make your case for why you think…
A: Lexical Analysis: It is the first phase of compiler designing. lexer takes the modified source code…
Q: In the context of a block chain Internet of Things application, describe the overall notion of…
A: Introduction: A unique sensor data storage, visualisation, and remote administration platform,…
Q: Computer science Explain why a combination of ethnography and prototyping is useful for requirements…
A: Introduction: Support for prototyping screen mockups is available. Why a combination of ethnography…
Q: Give two examples of how to combine IPv4 and IPv6 addresses in a single network.
A: Introduction: It is the most recent version of the internet protocol, IPv6, and it employs 128-bit…
Q: es, describe what telligence applicat Tii
A: intelligence architecture alludes to the guidelines and principles that administer information…
Q: In ASP.NET, explain the many ways in which state management may be implemented.
A: Introduction: ASP.NET is a server-side web application framework that allows you to create dynamic…
Q: What exactly does the term "debugging" mean?
A: Introduction: It is a method of evaluating the functionality of a software application with the goal…
Q: How has the convergence of computers, telecommunications, and media led in the creation and…
A: Extend your discussion of how the convergence of computers, telecommunications, and media has led to…
Q: Discuss briefly the four limitations that govern our behaviour in real life: law, norms, the market,…
A: According to Lessig, internet users are influenced by four modalities: the law, the market, social…
Q: Identify the conditions that must be met for a computer system to enter a deadlock condition. 2. b.…
A: Let us see the answer Since you have asked multiple questions I am solving first for you if you want…
Q: Why do file management systems, in contrast to database techniques, compromise on data integrity?
A: Let us see the answer Introduction The quality and consistency (validity) of data throughout its…
Q: responsibilities that come with p Gy reliability and performance?
A: Introduction: Assisting living services on intelligent structures is an ordinary utilization of…
Q: What happens if a process attempts to visit a page that hasn't been cached? What are the phases in…
A: Goal: We will examine demand paging, where the page is not in memory and is brought on-demand.…
Q: What are some of the most important supplementary terminology linked with the use of Web services?
A: Web services: With HTML, XML, WSDL, SOAP, and other open standards, a web service allows many…
Q: Crypt feedback mode and cypher block chaining are both better options for sending large files…
A: The following is the Block Chaining Mode for the DES (Data Encryption Standard) Cipher: It is a…
C++ assignment
Write a C++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- C++ Programming: Instructions The program in Example 5-6 implements the Number Guessing Game. However, in that program, the user is given as many tries as needed to guess the correct number. Rewrite the program so that the user has no more than five tries to guess the correct number. Your program should print an appropriate message, such as “You win!” or “You lose!”. Code Given: //Flag-controlled while loop. //Number guessing game. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int num; //variable to store the random number int guess; //variable to store the number guessed by the user bool isGuessed; //boolean variable to control the loop srand(time(0)); num = rand() % 100; isGuessed = false; while (!isGuessed) { cout << "Enter an integer greater" <<" than or equal to 0 and " <<"less than 100: "; cin >> guess; cout << endl; if (guess == num) { cout << "You win! " <<…Instructions: In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00C++ coding help Write a program that prompts the user for a positive integer, the first term in a hailstone sequence, and then generates a subsequence from that hailstone number to the next occurrence of 1 in the sequence. The program should also determine and display the sum and length of the subsequence. If the user enters an integer less than 1, the program should display an error message as shown in the sample run. In order for the program to handle large integers, use long rather than int when declaring them.
- C++ Programming Instructions Write a program that prompts the user for a sequence of characters (all typed on a single line) and counts the number of vowels ('a', 'e', 'i', 'o', 'u'), consonants, and any other characters that appear in the input. The user terminates input by typing either the period (.) or exclamation mark character (!) followed by the Enter key on your keyboard. Your program will not count white space characters.I.e., you will ignore white space characters.Though, the cin statement will skip white space characters in the input for you. Your program will not be case-sensitive. Thus, the characters 'a' and 'A' are both vowels and the characters 'b' and 'B' are both consonants. For example, the input How? 1, 2, 3. contains one vowel, two consonants, and six other kinds of characters. IMPORTANT: Your program must use the while statement only when looping. I.e., do not use a for statement or any other looping statement. Test 1 > run Enter text: . Your sentence has 0…c## please Write a Console Application that reads two integers, determines whether the first is a multiple of the second and displays the result. [Hint: Use the remainder operator.]c++ Write a function that will generate a random number between 1 and 100. Then it ask the user to guess a number between 1 and 100. If the user’s entry is equal to the random number, it will display “You are a winner”; otherwise, it will display: “You did not win”
- c++ looping and decision making Write a program that can be used by a student to help with basic math problems. The program should display a menu which allows the student to choose one of the following math problems: addition subtraction multiplication division – DO NOT allow division by 0. the final selection should let the user quit the program 1. The math problem selected should allow the student to enter the appropriate inputs and after they press the [Enter] key, the program should display the correct answer. 2. After the user has finished the math problem, the program should display the menu again. This process is repeated until the user chooses to quit the program. Input Validation: If the user selects an item not on the menu, display an error message and display the menu again.C++ Write a program that will accept the student's name. The program holds 20 names of students. The user must able to display the name of the student by entering its corresponding number.Use C Language Airline Reservation System A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats). Your program should display the following menu of alternatives: Please type 1 for "first class" Please type 2 for "economy" If the person types 1, then your program should assign a seat in the first class section (seats 1-5). If the person types 2, then your program should assign a seat in the economy section (seats 6-10). Your program should then print a boarding pass indicating the person's seat number and whether it is in the first class or economy section of the plane. Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of…
- Ineed help programming this C++ program: Write a C++ console application that calculates and displays the charges for using a parking garage. The parking garage charges a $3.00 minimum fee to park for up to three hours. The garage charges an additional $0.85 per hour or fraction of an hour in excess of three hours. The maximum charge for any given 24-hour period is $20.00. You may assume that no car parks for longer than 24 hours at a time. Your program will use a function named calculateCharges to determine the charges based on the amount of time the car was parked. Your program will prompt the user for the number of hours parked in the garage. It will then display the parking charges for that transaction. Keep track of the number of transactions as well as accumulating the number of hours parked and the parking charges. Your program will execute repeatedly until the user enters a value for the number of hours parked that is less than or equal to zero. Your program will then display…C++ Ingredient Adjuster A cookie recipe calls for the following ingredients: 5 cups of sugar 1 cup of butter 75 cups of flour The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies. Use fixed-point notation with two decimal places of precision.Home Work 2: It is required from you to write a code in C language to find the average for any five numbers.