********C++********
Develop the code to solve the problem statement below. Follow
these style guidelines as you develop the code. Use commenting to
describe your code, and practice debugging if you run into errors.
Submit your final source code.
Problem Statement: Open the rule document for the
game you selected for your final project:
Use the document to write rules for the user on how to play the game in a text file. Then, using the information from the resource articles, create a program that will read in the text file and display it out to the user.
Code in C++:
/*
C++ program to read rules from a text file and print them to the
user
We use ifstream from the header file fstream to read from the
file
We run a while loop to read line by line till file has not been
read completely
*/
#include <iostream>
#include <fstream>
using namespace std;
//Main Function
int main()
{
string st;
ifstream file("rules.txt"); //reading file
cout << "The rules are as follows :" << endl;
if (file.is_open())
{
while(getline(file,st)) //while lines are still there in the
file
{
cout << st << ' ';
}
file.close(); //closing file after use
}
else
{
cout << "Cannot open file";
}
return 0;
}
Output :

********C++******** Develop the code to solve the problem statement below. Follow these style guidelines as you...
I need help figuring out how to code this in C++ in Visual Studio. Problem Statement: Open the rule document for the game LCR Rules Dice Game. Develop the code, use commenting to describe your code and practice debugging if you run into errors. Submit source code. Use the document to write rules for the user on how to play the game in a text file. Then, using the information from the resource articles, create a program that will read...
C# Code: Write the code that simulates the gambling game of craps. To play the game, a player rolls a pair of dice (2 die). After the dice come to rest, the sum of the faces of the 2 die is calculated. If the sum is 7 or 11 on the first throw, the player wins and the game is over. If the sum is 2, 3, or 12 on the first throw, the player loses and the game is...
In need of some help with a LCR C++ game. The code will run, but I need it to cycle through the turns automatically so that the only input from the user is the number of players. It's also showing the winner as the person with 0 chips which is incorrect and I can't figure out why. Any help is greatly appreciated as this is already late. Game rules: Develop a program that follows the rules of Left Center Right...
Develop a functional flowchart and then write a C++ program to
solve the following problem.
1. Create a text file named c1.txt and write your brand of
computer (like Dell, HP, etc) in the file. You will be reading the
name of the file from the keyboard as a string, using the string
class. Your program will also read the brand of your computer from
the keyboard. The process of the file creation (name of the file,
mode for opening...
please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1. Write a program for the following. NOTE that some of these steps are not dependent on each other. Using methods is mandatory. Make sure to use methods where it makes sense. a. Ask the user for a series of integers entered from the keyboard. Use a sentinel value such as 999 to end the input process. If the entered values are not integers, throw...
needs to be written in c++ code For this assessment, you will develop an application. The application should allow the user to perform a simple calculation. (You should determine the calculation that the user should be able to perform with the application; the user simply inputs or navigates through information to be able to calculate it.) The user entries will be saved in the appropriate data type, and variables will be used to perform the calculation and return the result...
this assingent is to pseudocode, i have instructions
and the example my teacher had given me for this, could i have some
assistance, i need to do this in netbeans IDE and i need to use the
scanner method as well and i need to pass both.
Overview: This assignment will allow you to use pseudocode to implement the program to see the value in planning first, coding later. While coding is the glamorous part of the job, software development is...
Help please, write code in c++. The assignment is about making a hangman game. Instructions: This program is part 1 of a larger program. Eventually, it will be a complete Hangman game. For this part, the program will Prompt the user for a game number, Read a specific word from a file, Loop through and display each stage of the hangman character I recommend using a counter while loop and letting the counter be the number of wrong guesses. This...
Using C language to solve the problem below:
3. (5 pts) Construct a do-while () loop, which continues to display the following menu: 1. Play game 2. Display score 3. Deposit funds 4. Exit and prompt the user for an option, while the option entered by the user is not in the range 1- 4, inclusive. Note: you are constructing an input validation loop. Show all variable declarations.
IN JAVASCRIPT
5. Write the pseudo code to solve the following problem (10pts/10pts) You are asked to write a calculator program. Your calculator must perform Addition, Subtraction, Division and Multiplication. The user will enter two numbers and then an operator. If the user enters an operator other than the four mentioned the program will display an error message otherwise it will display the answer. Demonstrate use of an if statement