C++ using struct

已完成 已发布的 Oct 4, 2012 货到付款
已完成 货到付款

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.

PHP 软件构架

项目ID: #2539206

关于项目

9个方案 远程项目 活跃的Oct 6, 2012

授予:

rhythmist

I'll help to do it!

$30 USD 在1天内
(0条评论)
0.0

有9名威客正在参与此工作的竞标,均价$54/小时

zeke

Expert C/C++ developer. Available to start immediately and finish within a hour. Best regards, Zeke

$30 USD 在0天内
(149条评论)
6.9
dobreiiita

Hi, I am C++ expert and can surely help you here, Thanks

$30USD 在1天里
(45条评论)
5.7
it2051229

Hi, kindly check your inbox for my inquiries. Thanks.

$30 USD 在0天内
(69条评论)
5.4
duquef21

Gladly at your service!

$30 USD 在0天内
(1条评论)
3.9
geniousPHP

We can start now !

$30USD 在1天里
(4条评论)
3.0
imfsolution

hi! A professional developer is here. Please see PM. Thanks!

$30 USD 在0天内
(7条评论)
3.0
vladang

Hello sir. I understand what you want, and I am ready to do this job

$30USD 在1天里
(4条评论)
2.3