Write a c++ program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O. The program displays the game positions as follows: 1 2 3 4 5 6 7 8 9 The players enter their moves by entering the position number they wish to mark. After each move, the program displays the changed board. A sample board configuration is as follows: X X O 4 5 6 O 8 9
Q: Write a C++ program in which the user can enter a number of rows to print the half star pyramid…
A: In this program, you need to take user input for number of rows. Then you need to print desired…
Q: Write a C# program that prints a table with a list of at least 5 students together with their grades…
A: Please find the answer below :
Q: Exercise : Write a C++ program that computes and returns: • the smallest positive integer (n) for…
A: Program Approach: Including a necessary header file Defining method compute Declare variable 0 to n…
Q: Write a simple C program that can determine whether a machine is little- or big-endian. 2. Printing…
A: Here is the solution:-
Q: Write a C++ program that will simulate a Point-of-Sales terminal in Snack Bar. For example,these…
A: Begin Enter values of items in a variable Set default value of quantity of all the items=0 Take user…
Q: Write a C# program that plays a guessing game with the user. Your program should select a random…
A: rndNumber.Next(1,50) will generate random number in range of 1 to 50. compare the random number…
Q: Write a C program that prompts the user to enter a positive integer between 100 and 9999 inclusive).…
A: Logic: - first check the range of input number. then count the number of digits if(count==3)…
Q: Write a C++ program that generates a plate number based on the user’s answer to the following…
A: Step 1 : Start Step 2 : In the main function, declare and initialize the number plate string with…
Q: * write a C program that inputs the old salary (os) and the new salary (ns) of an employee. Then it…
A: The flowchart is a diagram in which we represent the problem solution in a pictorial way by using…
Q: Write a c program that calculates a degree classification such that number of modules used for the…
A: ALGORITHM:- 1. Take input for the marks of 10 subjects from user. 2. Calculate the total of all the…
Q: Write a C++ program that displays a table of conversions from feet to meters. The program needs to…
A: C++ program that displays a table of conversions from feet to meters. Algorithm: Start prompt…
Q: Write a C/C++ program that asks the user for three integer marks. These are the student marks out of…
A: Program Plan: 1. Include all the necessary header files. 2. Declare all the variables required. 3.…
Q: Write a C program that inputs number of rows in a class room (r) and number of seats in the row (rs)…
A: Q: Program the given in C language
Q: Write a C++ program that calculates the due amount for a cellular telephone bill. The cell company…
A: Here is the c++ code: See below step for code:
Q: Write a c++ program that plays a game with a single die (or dice). Each number on the die is…
A: function main: Start declare dice, sum =0 declare user_choice do for i = 1 to 5 folow step 6…
Q: write a C++ program that determines whether or not a password is good. A good password is defined…
A: Code in c++ #include<iostream> using namespace std; // function to check if the password is…
Q: Write a program using c++that plays a dice game called "21" It is a variation on BlackJack where…
A: I will implement the above game with the help of rand() function in c++ to get a random number…
Q: PRG12: Write a program that will simulate the Paper, Rock, Scissors game. Two players should be able…
A: ## As no language is mentioned, we write the code in Python language. print("\n\n…
Q: create a program in c that mimics the following dice game: A player rolls two dice. Each die has six…
A: There are two different questions was asked. The below answer is provided for the first question. If…
Q: Write a C/C++ program that asks the user for three integer marks. These are the student marks out of…
A: The required C++ code is given below: #include<iostream>#include<iomanip>using namespace…
Q: Loops question. Write a C program that reads an integer k from the user and then prints the…
A: The main objective of the C program, main. c is to prompt the user to enter a value and read the…
Q: Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches,…
A:
Q: In this c++ program you are asked to design a 2 x 2 x 2 Rubik's cube that is filled with numbers…
A: Given: In this c++ program you are asked to design a 2 x 2 x 2 Rubik's cube that is filled with…
Q: Write a C/C++ program that asks the user for three integer marks. These are the student marks out of…
A: To accept the student marks, we use mark[i]. In first for loop it will take 3 student marks. In…
Q: Write a C# program that plays a guessing game with the user. Your program should select a random…
A: Given Hints:- Some Random Number Generation HintsRandom rndNumber = new…
Q: Write a program that simulates the control software for a “people mover" system, a set of driverless…
A: Given requirement, Write a program that simulates the control software for a "people mover" system,…
Q: Write a C program that asks the user to enter the number of pencils (in Kilograms) that he wants to…
A: Note: - As per the guidelines we can only answer one specific at a time. Please resubmit the other…
Q: Write a C/C++ program that asks the user for three integer marks. These are the student marks out of…
A: The marks are calculated as 50% weightage from normal tests and 50% weightage from big test
Q: Write an interactive C program that prompts for and reads an integer number between 1,100 and…
A: Algorithm: The algorithm for the program is: Start Initialise the variables Read an integer between…
Q: Write a FORTRAN90 program that reads a student ID and his GP he program should print a message…
A: 1- In this assignment require, two input studentID, GPA, and display output according to them using…
Q: Write a c program that computes the square footage of a house given the dimensions of each room.…
A: EXPLANATION: - double readRoomDimensionAndComputeArea(): - The user is given the prompt to enter…
Q: Write a C program to assign passengers seat in an airplane. Assume a small airplane with seat…
A: Sample Response: //C program to assign passengers seat in an airplane//Required header files#include…
Q: Write a c program that plays a computerized form of the “guess the magic number” game. It works like…
A: Using rand() function in stdlib to generate a random number.
Q: gram in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the…
A: Write a program in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and…
Q: Write a C program which should handle books information for a book shop. It should be able to handle…
A: class book{ char bno[6]; char bname[50]; char aname[20]; public: void create_book() {…
Q: write a C++ program that determines whether or not a password is good. A good password is defined…
A: #include <iostream>using namespace std;//method to check a password is good//returns true if…
Q: Problem 4 Implement a small C program for the Omani Tesla cars customers. The program will be based…
A: Algorithm: Start Display the given menu to the user Ask the user to choose the tesla model Based on…
Q: Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches,…
A: Note: The product name, price and their code are not describe in the question so they are taken…
Q: Write a program to model a simple calculator. Each data line should consist of the next operation to…
A: Here, we have to implement a calculator that works on following valid operators:- + add- subtract*…
Q: Q # 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start…
A: PROGRAM CODE: #include <stdio.h>#include <stdlib.h>int menu();int roll_a_dice(); int…
Q: write a c program Count Dracula buys blood from the public. But since he prefers certain types to…
A: Given The answer is given below.
Q: Write a C program for a match-stick game between the computer and a user. Your program should ensure…
A:
Q: Write a c++ program for a bank in your town that updates its customers’ accounts at the end of each…
A: Objective: This program implements the Bank account problem in which the user inserts values for his…
Q: Write a C++ program that calculates the due amount for a cellular telephone bill. The cell company…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: Write a c++ program to assign passengers seats in an airplane. Assume a small airplane with seat…
A: Program Approach: Define a function named allfilled() with parameter as array. It will check…
Q: Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches,…
A: 1)Start 2)Display the menu 3)Ask user for input 4)Based on the input calculate total bill and…
Q: Write a C++ program that will display a menu consisting of 3 brands of soda, 3 kinds of sandwiches,…
A: Here is the approach :- Create three array one to store the names, Second to store the code ,…
Q: Write a program in C++ to handle the following scenario: Following is a list of tablets available in…
A: We will be developing a C++ program to handle the following scenario of the medicine store
Q: on a C++ program and using loops code this problem, The game of "23" is a two-player game that…
A: Here I have created an infinite loop, and then input from the user for the choice to play the game,…
Q: Write a C++ Program for a perfect voting system for the country. If a voter votes for PPP a message…
A: Program code: //include the header files#include <iostream>using namespace std;//define the…
Write a c++
1 2 3
4 5 6
7 8 9
The players enter their moves by entering the position number they wish to mark. After each move, the program displays the changed board. A sample board configuration is as follows:
X X O
4 5 6
O 8 9
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Write a complete C++ program that will solve the following problem: The Shubert Theater in New Haven would like you to write a program for them to process ticket charges for their shows. Customers purchasing tickets can use them at any time while the play is on Each customer is charged a ticket processing fee of 12.99. Additionally, the following table rates apply to a customer for their tickets Play Code Play Section Code о Ticket Cost Once a New Musica Once a New Musical Once a New Musical Cinderella Cinderella B $104 $88 554 $76 $38 (Section Code © = Orchestra, M = Mezzanine B = Balcony) The Orchestra seats (O) are on the first level and are the best seats in the house. The seats in the Mezzanine level is on the second floor, further away from the stage. The Balcony seats are on the 3 level and are the cheapest seats. Your program should do the following: A. Get data from a file called: customers.dat. The file contains the customer ID number, the number of tickets desired, the play…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…Write a program in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the bingo card for a winner via 2 users Steps: 1- Ask user 1 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 2- Ask user 2 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 3- Design 2 BINGO cards as you see below 4- Distribute the numbers onto the 2 cards with each user input with 0 in the middle 5- Display the 2 cards in 1 screen as you see below 6- Generate a random number between 10-40 no duplicates / check for range and repetition 7- Compare the random number with the numbers on the 2 cards 8- If the random number matches any number on each card, change the number on the card to 0 9- Check for winning cards 5 numbers in a row or column = 0 5 numbers in a diagonal = 0 all 4 corners of the card = 0 if any of the players won, display who is the winner and exit the program if the 2 players won, display both are…
- Write a c++ program to assign passengers seats in an airplane. Assume a small airplane with seat numbering as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7 A B C D The program should display the seat pattern, with an 'X' marking the seats already assigned. For example, after seats 1A, 2B, and 4C are taken, the display should look like this: 1 X B C D 2 A X C D 3 A B C D 4 A B X D 5 A B C D 6 A B C D 7 A B C D After displaying the seats available, the program prompts for the seat desired, the user types in a seat, and then the display of available seats is updated. This continues until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should say that that seat is occupied and ask…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 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 that will simulate a Point-of-Sales terminal in Snack Bar. For example,these are the items available for purchase and their corresponding unit prices: Hot Dog Php 45.50 Hamburger Php 35.75 French Fries Php 25.85 Milk Shake Php 15.75 The terminal will ask the client to enter the quantity per item listed above. If in case, the client don't want to buy a particular product just give 0 on thatitem. The terminal will compute the cost per item and will generate a Transaction Receipt at the end. The terminal will also ask the client how much money to tender in order to pay the cost of the items bought. It will also compute for the VAT (value-added tax) on the total purchase say 20% of the total sales. See sample run output:Can you write a new code in C ++ language with the values I sent you, just like this output? There are two files named group1.txt and group2.txt that contain course information and grades of each student for each class. I will calculate each course average for each group and show in simple bar graph. Use "*" and "#"characters for group1 and group2, respectively. I will see the number -999 at the end of each line in the input files. This value is used for line termination and you can use it to verify that you have arrived at the end of the line. The averages of each group should also be calculated and printed at the end of the file. All of the results will be printed to the file. There will be no screen output. Sample output is shown in Figure 1. Group 1: CSC 80 100 70 80 72 90 89 100 83 70 90 73 85 90 -999ENG 80 90 80 94 90 74 78 63 83 80 90 -999HIS 90 70 80 70 90 50 89 83 90 68 90 60 80 -999MTH 74 80 75 89 90 73 90 82 74 90 84 100 90 79 -999PHY 100 83 93 80 63 78 88…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.
- I want the code in C++. 7.10: Tic Tac Toe (sort of) Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O. The program displays the game positions as follows: 123 456 789 The players enter their moves by entering the position number (a single digit, 1-9) they wish to mark. After each move, the program re-displays the changed board. A sample board configuration is as follows: XXO 456 O89 SAMPLE RUN #1: ./ETest Interactive Session 1 2 3 4 5 6 7 8 9 Enter move:1 X 2 3 4 5 6 7 8 9 Enter move:2 X O 3 4 5 6 7 8 9 Enter move:3 X O X 4 5 6 7 8 9 Enter move:4 X O X O 5 6 7 8 9 Enter move:5 X O X O X 6 7 8 9 Enter move:6 X O X O X O 7 8 9 Enter move:7 X O X O X O X 8 9 Enter move:8 X O X O X O X O 9 Enter move:9 X O X O X O X O X Game over!In C++, write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows: Input three different integers: 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27Write a c program that calculates the potential energy of 3 charges q1=1, q2=2, q3=3 located at points (1,2,3), (3,−4,−5), and (−4,2,−6) respectively. The units are coulombs forcharge and meters for coordinates. The energy is given by the expression; U=k(q1q2/r12+q2q3/r23+q1q3/r13) where rij is the distance between the charges qi and qj, and k= 9×109in SI units.Your program should print the result on the screen.