Based on the Captain Adventure Story in Chapter 4

Anonymous
timer Asked: Aug 16th, 2017
account_balance_wallet $20

Question description

Assignment Instructions

Based on the Captain Adventure Story in Chapter 4, create an array to collect story information, collect the story information from the user and add a few lines to the story.

Begin this exercise with the starter file in the Assignment zip folder.


Requirements

Points

Collect story information from the user via an array instead of single data -Declare an Array that can hold 5 values

25

Collect the information from the user with your defined array

50

Add a few lines to the end of the story for the sequel where your arch nemesis comes for revenge!
Note: The string can only output a certain number of characters. You will need to shorten the story in some way in order to add the sequel hook.

25

TOTAL POINTS

100



I've added a few things that may be helpful

Overview Welcome to ENTD261: Scripting Languages for the administrator, week 2. Server administrators use scripting to automate many routine tasks that must be accomplished in their day-to-day work. In large organizations with large numbers of employees, routine tasks such as the creation of new user account and the management of user resources would be very cumbersome and time-consuming if they have to be accomplished manually for each user. Instead, server administrators create scripts for the purpose of batch processing routine jobs for multiple users or resources at once. Scripts can also be used to automate routine tasks that must be accomplished on a regular basis. Instead of manually going through the steps of accomplishing certain routine tasks such as backing up data, running security checks on the network, and creating status reports on network usage, system administrators can write scripts to accomplish each of these tasks and then scheduled scripts to run at a certain time of the day when network usage is low and system resources are available to accomplish each of these routine tasks. Lesson Objectives The high level Lesson objectives this week are a continuation of last week. We will dive deeper into the coding process now that we have the foundation and have answered the “why”. It’s good to note there are many scripting languages available for server administrators to choose from when writing scripts to automate their workload. We will examine for such scripting languages in this course: Windows shell scripting, JScript, VBScript, and Perl. There is no one scripting language that is better than all of the others. Instead, each scripting language has its strengths and weaknesses. The best way to learn which scripting language is most suitable for which task is through experience. The more familiar you become with a variety of scripting languages, the easier it will be for you to identify the appropriate scripting language for each task you need to accomplish in your work. Lesson Details As mentioned in the previous slide, you will dive deeper into the rules for writing VBScript and gain exposure to the concepts of objects and functions. Data can be seen in three states: processing, storage and transmission. We will see our data in all three states. We can process it through an algorithm, or mathematical equation, we can store it in a variable, like you store shoes in a shoe box. And, we can transmit data, or send it someplace for something to be done, like the output of a banking ATM. Happy coding! WEEK 2 CODE EXAMPLES 1 TRANSCRIPTS: Overview Let’s take a look at some of the key coding examples displayed in Chapters 3 and 4. For a quick and easy way to view your scripting files, I will be using Notepad++. The tool is downloadable for free. It provides nice options when saving and displaying data. Data displays are some what color-coded, which helps to train your eye to be attracted to the key points of your code. For example, when you’re missing a symbol, you may notice the code displaying differently, and hence be able to trouble shoot a bit better. Array Demo The array demo is an example of storing data in a variable called an array. An array is a unique variable that can hold multiple variables in slots. Think of the variable as a filling cabinet and the slots like the folders in the filling cabinet. We can call the filing cabinet, grayCabinet, and each item in it would be assigned a number from 0 to how ever many items were stored in folders in the cabinet. Keep in mind, we start counting from zero instead of 1 in most programming languages. Zero, in this case, is simply an available slot. The program we see here declares in memory the variable astrGameArray. After the declaration, slots zero through 4 are utilized with the string data in double quotes. (Note, vbCrLf is the reserved word for vb Carriage Return Line Feed. This brings the cursor to the next line (as seen in the output.) Lines 14 and 15 display the first line of the output. Lines 24 through 27 handle the output of each slot in the array. We use a For Each loop to loop through the array. Lastly, the Wscript.Echo command is used to return the data in line 25 back to the output of the message box. Math Game The Math Game is an example of data transmission into Wordpad and the built in calculator and processing through an equation. The variables used in the program are listed on line 9. A constant is used in line 13. A constant variable should be used if a value will never change. You might more commonly see a constant for a number such as Pi or a multiplier like 60 seconds or 24 hours. Line 16 begins the script and line 18 displays the InputBox requesting the value to the answer of the mathematical equation. Don’t try to answer the correct value here, but instead the incorrect value and you’ll see the program take you through the solution in WordPad and then on the built-in calculator. Lines 22 to 25 and 28 to 31 perform some error handling for the programing. In the first condition, we are testing the InputBox value for length. If the length of the input is null, or there was nothing entered, the error message on line 23 appears. In the second condition, we are testing the Input Box for a number. If the user entered a character or symbol on accident, the error message on line 29 appears. Lines 34 to 35 check the input value for the correct answer. If the user correctly guesses 16, the program can end per the conditional statement. If the users enters a number that is not correct, the fun begins on line 26. On line 38, the value of 36 is denoted for the Yes and No buttons. If the user selects the value of 6, or the Yes button, line 40s condition is met and the condition continues. If the user enters no, the condition is met and the program concludes. Looking further in the condition for selecting the Yes button, we see code showing our script to sleep 2000. What this code does is allows the user a few seconds to read the output. The number is measured in milliseconds, so the value of 2000 is equivalent to 2 seconds. This allows just enough time to follow along on WordPad. Lastly, WordPad is exited and the calculator begins on line 66. The same sleep of 2000 is applied so the has an opportunity to see the information entered slowly. Also note, the F4 key is used to quit an application. Lines 83 and 62 do just that. Understand the Message Box Command Please do take a look at the following resource, if you are still scratching your head on the values in the Message Box code for 3 and 6. This is a quick explanation of the buttons and how they are interpreted to the MsgBox method. WEEK 2 CODE EXAMPLES 2 TRANSCRIPTS: Overview This next coding example is most similar to your assignment. You will see how various parameters can store data and then transmit to the user in a fun children’s story. Captain Adventure Line 11, 14 and 15 open the program by declaring some of the constant and normal variables to be used in the program. Line 18 sets the welcome message for the user and line 25 executes it. The Space function is useful for formatting output and clearing data in fixed-length strings. The number in parentheses will dictate how many spaces. Line 25 displays the welcome message, the Ok button with vbOkOnly, an Explanation symbol on the message box and the title of the Game on the top of the box. Lines 28 to 35 collect the information from the user. As well, the third parameter is a default text and will be stored in each parameter if nothing is entered. This can provide the end user with instruction and guidance should it not be provided prior to filling out the form or information. Lines 38 through 56 assemble the data into the Captain Adventure story. Line 59 displays the story with an OK button and an Exclamation symbol along with the game name constant in the status bar of the message box. Can you already see how valuable it would be to store the data in an array rather than separate parameters? References/Works Cited: Ford, J. L. (2015). Microsoft windows shell scripting programming for the absolute beginner. Portland, OR: Premier Press.
WELCOME TO WEEK TWO This week you will continue learning about Windows Shell Scripting. You will learn about processing and storing data during the script execution. Some of the topics covered this week will include: • • • • • • • • • The basic rules that you must follow when writing VBSciprts The objects that make up the VBScript core and run-time object models How to enhance your scripts using built-in VBScript functions Different ways of displaying script output How to process data passed to the script at execution time How to store data that does not change how to work with data that can change during script execution How to process collections of related data as a unit WSH and VBScript This week you will learn programming concepts that can be used for retrieving user information, storing it and displaying it back to the user in a relevant manner. Validation of information collected in a session can be used to validate a user and ensure a session is currently active. THIS WEEK COMPLETE THE FOLLOWING: • Read Contents for Week 2 Lesson Area

Tutor Answer

Teacher.1
School: UC Berkeley

helloI know I have taken long but it was a real struggle for me to combine this thingsplease feel free to consult methank you for trusting in me

astrGameArray(0) = InputBox("What is your name?", cGameTitle, astrGameArray(0))
astrGameArray(1) = InputBox("Name a place you would like to visit.", _
cGameTitle, astrGameArray(1))
astrGameArray(2) = InputBox("Name a strange object.", cGameTitle, astrGameArray(2))
astrGameArray(3) = InputBox("Type the name of a close friend.", _
cGameTitle, astrGameArray(3))
astrGameArray(4) = InputBox("Type the name of your favorite dessert.", _
cGameTitle, astrGameArray(4))
strStory = "Once upon a time ..........." & vbCrLf & vbCrLf & _
strName & " went on vacation in the far away land of " & strVacation & _
". A local tour guide suggested cave exploration. While in the cave " & _
strName & " ac...

flag Report DMCA
Review

Anonymous
Thanks, good work

Similar Questions
Hot Questions
Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors