C++ using struct
$30-250 USD
货到付款
Write a program, [url removed, login to view], that uses a struct called block which has three fields:
1. An integer rows
2. An integer cols
3. An character letter
A block will be declared and initialized in main. The program should repeatedly read one of the following commands until a q is entered:
r: Change the number of rows in the block
c: Change the number of columns in the block
l: Change the letter in the block
a: Change the letter in the block based on an ASCII value
p: Print the block in two dimensional format
If an illegal command is entered, the program should print an appropriate error message.
You are required to write the following six functions:
// initializes the block to 4 rows, 4 columns and the
// letter *
void init_block (block& b);
// prompts for and reads a number of rows from the user
// and assigns that number of rows to the block
void change_rows (block& b);
// prompts for and reads a number of columns from
// the user and assigns that number of columns to the
// block
void change_cols (block& b);
// prompts for and reads the ASCII value of a character
// from the user and sets the letter in the block to
// that character
void change_ascii (block& b);
// prompts for and reads a letter from
// the user and assigns that letter to the
// block
void change_letter (block& b);
// prints the block in two dimensional format with a
// label
void print (block b);
The following page shows a sample run of the program (user input in bold). Your program should use the same output formatting.
项目ID: #2539206
关于项目
授予:
有9名威客正在参与此工作的竞标,均价$54/小时
Expert C/C++ developer. Available to start immediately and finish within a hour. Best regards, Zeke