Illustrate your knowledge of C-Programming
Q: Write and run a C++ program that will ask the userto enter a numberand display the following…
A: The Answer is
Q: 1. Which end? Write a simple C program that can determine whether a machine is little- or…
A: Below is the code for the first problem , post the other problem as another as per our rules.
Q: Write a C++ program to create a 4-function calculator.
A: those two operands depending upon the operator entered by the user. Example: Simple Calculator…
Q: Draw a flowchart for a C-POGRAM that can solve the problem below. Develop a c program that will…
A: The flowchart and required C program are provided in the succeeding steps.
Q: Write a simple C++ program that uses local variables, and convert the C++ program to Pep/9 assembly…
A: Program Plan: 1. First write a simple C++ program, here I am going to write a program which…
Q: Write a C# program that declares your name, age, and the departmen
A: name and department are stored as string whereas age is stored as integer Along with declaration, in…
Q: Using C program, please answer the question using a example C program illustration. Design a small…
A: Introduction: SIGPIPE is a signal that is sent to a process when it tries to write to a pipe whose…
Q: please write that program with C language
A: The answer to the following question :-
Q: Write a C program to demonstrate the use of extern.
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: op, develop a C++ program that lays the output as follows:
A: Explanation: make two variables to track the sum of 100 students and maximum element. Code:…
Q: Write a C++ program to display your University name, college name and department name at three…
A: When we consider a C++ program, it can be defined as a collection of objects that communicate via…
Q: Write a c# program that takes four characters and display in reverse order
A: Given:
Q: Discuss generally how you could get a C++ Program running
A: Introduction: C++ is one of the programming language that is based on the partially object oriented…
Q: Write a C++ program to read and write from the file, three numbers (No.1, No.2 and No.3) and…
A: Given: c++ program to read and write from a file, three numbers and calculate them using data…
Q: 5- Write a C++ program to display your University name at one line at screen.
A: first take input from user for the name of university using cin. after that you can use cout…
Q: write a program using c++
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: Write a C# program that accepts your name and age as input from the user
A: Start. Ask the user to input their name and age. Print the same. Exit.
Q: Write a c++ program on hotel room reservation system .
A: Writing in C++
Q: C program
A: Given :- The programming language used would be C programming and take Celsius as input from the…
Q: Write a general layout of C++ program. Comment on each part of it.
A: Please find the answer below :
Q: Write a C++ program that will ask the user about two numbers then the user must choose one of the…
A: Start Input choice If choice 1 Then Perform Addition Print Result Stop
Q: Write a C program that would generate the pattern below:
A: #include <stdio.h> #include <conio.h> int main() { int p,q ; for (p = 1;…
Q: ******* ******* * * * ** * * *
A: logic:- start a loop from i=0 to 9 (9 rows are there) print("*") if (i==0 || i==9) start a…
Q: Create a C# program that will check if a string is a palindrome
A: Code: using System; /*class definition*/ class Palindrome { /*main method*/ static void Main() {…
Q: create a c++ program that takes two string answers.
A: Note: since you have asked program that takes two string as input only. Strings are defined as an…
Q: Write a c program to display your name, age, stage, department, and college
A: C used to answer this question
Q: a) Write a C+ program that inputs a three digits number from the user and display it in reverse…
A: Program using c ++ input value from user and display in reverse order.
Q: Describe how you would achieve a program in C++ that does the following: Output a header and page…
A: We can not use parameters We can not use non-local variables. Which means we can not use a global…
Q: I need a very basic c++ program written in C++ and then converted to pep9 machine language in…
A: Actually, program is a executable software that runs on a computer.
Q: Write a C++ program that displays the results of the expressions 15 / .4, 15 % 4, and 5 * 3 - (6 *…
A: Problem. Write a C++ program that displays the results of the expressions 15 / 4, 15 % 4, and 5 * 3…
Q: Write a program using the C ++ OOP language, and the program should contain at least the following…
A: I made four classes to explain at least four of the following oop subject: OOP subjects explained…
Q: Write a C++ program using system of linear equations
A: Here is the source code of the C++ Program to Represent System of Linear Equations in Matrix Form.…
Q: Write A C# program to display a message "Programming with C#"
A: Below is the required C# program: - Approach: - Using the package system. Define the class “Test”.…
Q: Create a C++ program where in a user is asked to enter a statement as string and then asked for a…
A: #include <iostream> using namespace std; int main() { string str; getline(cin, str);…
Q: Write a C program to take an infix notation as the input, convert it to prefix and evaluate the…
A: Infix expression is difficult to understand for computers whereas if the expression is written in…
Q: Generate the three-address code for the following 'C' program fragment, switch(i+j) { case 1 / x…
A: below is the three-address code for the following 'C' program fragment,
Q: Write a C program to read and store information about insurance policy holder. The information…
A:
Q: Write a C program that would generate the pattern below
A: Pattern programs are nothing but patterns consisting of numbers, alphabets, or symbols in a…
Q: use string manipulation techniques in a C++ programme, what header file is required?
A:
Q: Write a C++ program using the concept of loops. Your code must be written in such a way, that if it…
A: I have given an answer in step 2.
Q: Write a C++ program that displays a table of conversion between Celsius and Fahrenheit as following:…
A: The below given C++ program will obey the following rubrics: Including the required header file. In…
Q: write a C program to read a C program (file) and identify whether a given line is a comment or not.
A: C Program to read a file . #include <stdio.h> #include <stdlib.h> // For exit()…
Q: Write a C++ program to read and write from the file, one members (x) and one object, to calculate…
A: ifstream and ofstream are used to read and write to files and fstrteam is used for both. code to…
Q: Discuss the two different ways that a file may be opened inside of a C++ application. When might one…
A: Introduction: C++ is one of the programming languages which is the extended language of C language,…
Q: Describe the objectives of a C++ program.
A: To learn how “C++” language enhances the language “C” with object-oriented features. To acquire the…
Q: Write a C++ program to create a calculator using switch case the calculator has 4 operations (+,-,*,…
A: Steps in program: User will be asked to enter option to perform operation. User will be asked to…
Q: Draw a flowchart for a C-POGRAM that can solve the problem below. • Develop a c program that will…
A: Flow chart: It is used to represent program steps in the pictorial representation. Using the flow…
Q: Write a c program of the attachment attached below
A: PROGRAM CODE: #include<stdio.h> // include header file for input output…
Step by step
Solved in 4 steps with 3 images
- 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…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 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 program in C language to simulate tossing a “fair” coin. Allow the user to enter the number of tosses.Print the number of tosses that yield heads and the number of tosses that yield tails.What should be the percentage distribution of heads and tails? (Use the function rand_int)Write a C++ program that play the Card Guesssing Game. Your program must give the user the following choices:1. Guess only the face value of the card.2. Gues only the suit of the card.3. Guess both the face value and the suit of the card. Before the start of the game, create a deck of cards. Before each guess, use the function random_shuffle to randomly shuffle the deck.write a program in C++ that A user needs to determine the size of squares (let say delta) in a grid, the center of the circle (does not have to lie on a grid but it can!) and the radius. (for example use "cin>>" ) Then you need to plot a circle using parametric equations of circle (you need to increase angle and plot these (in my picture black) points). First plot the first point of the circle and determine in which square of grid it is. (in my picture it is an orange square) and plot the left bottom vertex of this square (in my picture it is a blue point). Then increase an angle and plot next point of circle - check if it lies in different square. -If it is not in different square, you need to increase angle and check again. (because an angle was too small) -If it is the different square, then check, if this square has THE COMMON EDGE with the previous one -> if it has the common edge, then print new left bottom vertex of this square (if does not have common edge,…
- 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 outputThe programming language is C++, write a program base on the given statement. Write a program that reads in the sales expenses of the Short DistanceTelephone Company for the past year and then calculate the profitand the next tax based on the ff. table PROFIT TAX RATE0 – 10000 010001 – 30000 100 + 3% OF THE PROFIT30001 – 50000 200 + 5% OF THE PROFITOVER 50000 300 + 7% OF THE PROFITWrite a program that determines an integer value the user had in mind. Your program first asks the user to enter the lower and upper bounds of the range that the integer belongs to, and then presents a series of questions “Is the number greater than x?” with yes/no answers to the user in order to determine the integer value that the user had in mind. For instance, if the integer in mind is 5 and the interaction between the user and your program is: Please enter the lower bound: -10 Please enter the upper bound: 50 Is the number greater than 20 (Y/N)? n Is the number greater than 4 (Y/N)? y Is the number greater than 12 (Y/N)? n Is the number greater than 8 (Y/N)? n Is the number greater than 6 (Y/N)? n Is the number greater than 5 (Y/N)? n Your program should then print: The number you had in mind is 5 Your program should ask roughly log2(upper_bound − lower_bound) questions. Your program A3_1.py should include a main() function and may include other functions that you prefer.…
- You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: Pine 0.89Fir 1.09Cedar 2.26Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…Using C++ Write a program 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 program in c++ that reads a person’s name in the following format: first name, thenmiddle name or initial, and then last name. The program then outputs the name in thefollowing format:last name, first name. middle initial.For example the inputMary Average Usershould produce the outputUser, Mary A.Your program should work the same and place a full stop after the middle initial evenif the input did not contain a full stop. Your program should allow for users who giveno middle name or initial. In that case, the output of courses contains no middle nameor initial. For example, the inputMary Usershould produce the outputUser, MaryYour program should also accept names in lowercase, uppercase or a mix oflowercase and uppercase, and display that in the correct format, e.g. if the input ismArY average USERshould produce the outputUser, Mary A.Use C-strings and assume that each name is at most 20 characters long.Hint: it may be easier to use 3 C-strings. Exercise from Problem Solving…