Jumbled Word Program

進行中 投稿 3年前 着払い
進行中 着払い

Complete incomplete code in C (not C++).

You will use 3 character arrays:

1. Jumbled word

2. Solution word

3. Guess word

• The jumbled word and the solution word will be read from an input file

• The user will be presented with the jumbled word

• The user will have 3 chances to guess the word

• If the user does not guess the word on the first guess, the first and last letters will be provided

• See the sample output below

• Be sure to greet the user and say goodbye to the user

• Be sure to change all 3 character arrays to all uppercase letters – use the toupper function from

ctype.h, one character at a time

• You will use %s to scanf the words and print the words

• You will use the strlen and strcmp functions from string.h

• You will use a do/while loop in the main function

Incomplete code:

// jumbled word game

#define _CRT_SECURE_NO_WARNINGS //for Visual Studio compiler

#pragma warning(disable:6031) //ignore scanf warnings

#include<stdio.h> //for printf, scanf, and fscanf

#include<ctype.h> //for toupper function

#include<string.h> //for strlen and strcmp functions

#define SIZE 25 //size of the character arrays is 25

void Instructions();

//Welcome the user and display the instructions on how to play the game.

void PlayOneGame(char jumbled[], char solution[]);

//input: solution word and scrambled word

//plays one round ot the game

void PlayAgain(char* againPtr);

//input: character (input/ouptput) parameter

//determines if the player would like to play again.

void UppercaseWord(char word[]);

//input: a character array with a null character (string)

//sets all of the characters in a word to uppercase letters

void WinOrLose(int win);

//input a 1 or a 0

//tells the user they won if the input is 1 and they lost if the input is 0

int main()

{

//declare character arrays here

//declare character and file pointer

//greet the user and disply the instructions

//connect to the input file

do {

//read 2 words fromthe file

//print the words to make sure they were read from the file correctly

//printf("\n jumbled is %s, correct is %s\n", jumbled, correct);

//change both jumbled and solution to uppercase letters

//play a round of the game -call the PlayOneGame function

//again?

} while //test

//say goodbye

//close the file pointer

//return Success (0)

}

void Instructions()

//Welcome the user and display the instructions on how to play the game.

{

//display a welcome message and game instructions

}

void PlayOneGame(char jumbled[], char solution[])

//input: solution word and scrambled word

//plays one round ot the game

{

//declare variables

//get the length of the solution word

//the user gets a maximum of 3 guesses

{

//display the number of letters and the jumbled word

//get the guess

//change the guess to uppercase letters

//use strcmp to see if guess and solution match

//stop the loop if they match (DO NOT USE A break statement to stop the loop)

//else the user did guess correctly

//display the first and lat letters

}

//disply the solution

//tell the user if they won or lost

}

void PlayAgain(char* againPtr)

//input: character (input/ouptput) parameter

//determines if the player would like to play again.

{

//again?

}

void UppercaseWord(char word[])

//input: a character array with a null character (string)

//sets all of the characters in a word to uppercase letters

{

//use strlen to get the length of the word

//use a loop to change all the letters of the word to upper case (toupper)

}

void WinOrLose(int win)

//input a 1 or a 0

//tells the user they won if the input is 1 and they lost if the input is 0

{

//let the user know if they won or lost the round

}

C プログラミング

プロジェクトID: #29810468

プロジェクトについて

5個の提案 リモートプロジェクト アクティブ 3年前

5人のフリーランサーが、平均$98 で、この仕事に入札しています。

sheikhnazeer3

Hello, I read your job offer regarding the C programming and I'm ready to start right away. I am also flexible with whatever budget you have. Accuracy and client's satisfaction is the top priority. Awaiting your res もっと

$100 USD 3日以内
(21件のレビュー)
4.5
devbaloni1983

❤️ ~ Hello ~ ❤️ As a professional who can realize your idea, I have rich experience in development for 15 years’ So far, I've always been striving only for customer satisfaction and have always provided Modern design もっと

$140 USD 7日以内
(3件のレビュー)
3.8
itahi

Hello :D It can assist you in that aspect I am good at C and Java I can show you some demo if needed Pls text me, if you need an assistance Thank You

$50 USD 2日以内
(レビュー1件)
1.7
shaojin

Hello! I can start work right now. I have over 7 years of experience in C++ developing. Because of COVID-19, I have started work in here from a few days ago. I am sure that you will be 100% satisfied. Please give me a もっと

$100 USD 1日以内
(レビュー1件)
0.9
dmitriishchetnik

Hello! Nice to meet you. I have read your proposal carefully and very interesting in your work. I have 10+ years experiences about C++/C#/Qt programming. Sure you will get good result. I will do my best for you and you もっと

$100 USD 7日以内
(0件のレビュー)
0.0