C++代写 | SIT102 Introduction to Programming Pass Task

本次为数组相关的基础入门C++用于创建自己的Working With Arrays项目

SIT102 Introduction to Programming
Pass Task 6.1: Working with Arrays Overview
In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, we’ll use the values to calculate some basic statistics.
Submission Details
Use the instructions on the following pages to create a small program to explore the use of arrays. Submit the following files to OnTrack.
Your program code
A screen shot of your program running Answers to the associated questions
The focus of this task is on the declaration and use of arrays.

Lets get started.
1. Create your own Working With Arrays project, and use your custom terminal user input code file and header (or copy in the code of your user input functions if you have not done these credit tasks).
2. Implement the features from the weekly videos including:
Read and display a list of names.
Create a function to calculate the total length of the list of names.
Create a function to return the shortest name.
Create a function to return the index of a given name within the list. return the index of a given name in the array. This should return -1 if the name is not present.
int index_of(string value, string data[], int size) {…}
Include a void print_summary(string data[], int size) procedure to do the
Print all names
Print total length of all names Print the shortest name
Print the index of your name
Have main create and work with an array of strings
Use a constant for the size (make it 5)
Loop to read in the names
Call print summary to output the details
Allow the user to change one of the names – ask them to enter the name to change, and then the new name. If the name to change was in the list, then replace the value at that index with the new name.
Call print summary again to output the new details
3. Run your program twice to test both with and without your name in the array, then grab a screenshot of the output.
4. Download the resources associated with this task and answer the questions. You should now be ready to submit.
Task Discussion
Discuss the following with your tutor to demonstrate your understanding of the concepts covered.
Explain how arrays work – how do they enable you to easily work with a list of values in code? Explain the role of the for loop in working with arrays
Discuss how the index of an array works. For example: Do you always need to loop through the array? Could you go backwards through an array (from end to start)? Explain how you can use an index if you want to know where one particular value is.


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:itcsdx