Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 8, Problem 1AW
Program Plan Intro
Array:
Array is a data structure that stores the sequence of similar type of data. It contains the sequence of data with common variable name and similar data type.
Syntax (in C++):
datatypearrayName[size] = {data1, data2,…,dataN};
Here,
datatype – Data type name
arrayName – Name of the array
size – It indicates the size of the array
- Declare a constant variable.
- Declare aString array with size “3”.
- Initialize the array with the names.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Computer Engineering lab
Python Language:
Word Sleuth Program
use java program
Chapter 8 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Ch. 8.1 - Prob. 8.1CPCh. 8.1 - Prob. 8.2CPCh. 8.1 - Prob. 8.3CPCh. 8.1 - Prob. 8.4CPCh. 8.1 - Prob. 8.5CPCh. 8.1 - Prob. 8.6CPCh. 8.1 - Prob. 8.7CPCh. 8.1 - What does array bounds checking mean?Ch. 8.1 - Prob. 8.9CPCh. 8.2 - Prob. 8.10CP
Ch. 8.2 - Prob. 8.11CPCh. 8.2 - What does the loop do in the sequential search...Ch. 8.2 - Prob. 8.13CPCh. 8.2 - How do you look for a partial string match when...Ch. 8.3 - Prob. 8.15CPCh. 8.3 - Prob. 8.16CPCh. 8.3 - Describe the algorithm for finding the highest...Ch. 8.3 - Prob. 8.18CPCh. 8.3 - Prob. 8.19CPCh. 8.4 - Prob. 8.20CPCh. 8.4 - Prob. 8.21CPCh. 8.5 - Prob. 8.22CPCh. 8.5 - Write a pseudocode statement that assigns the...Ch. 8.5 - Prob. 8.24CPCh. 8.5 - Prob. 8.25CPCh. 8.6 - Prob. 8.26CPCh. 8 - Prob. 1MCCh. 8 - Prob. 2MCCh. 8 - This is an individual storage location in an...Ch. 8 - Prob. 4MCCh. 8 - Prob. 5MCCh. 8 - Prob. 6MCCh. 8 - Prob. 7MCCh. 8 - Prob. 8MCCh. 8 - Prob. 9MCCh. 8 - Prob. 10MCCh. 8 - Prob. 1TFCh. 8 - Prob. 2TFCh. 8 - Prob. 3TFCh. 8 - Prob. 4TFCh. 8 - Prob. 5TFCh. 8 - Prob. 1SACh. 8 - Prob. 2SACh. 8 - Look at the following pseudocode: Constant Integer...Ch. 8 - Prob. 4SACh. 8 - Prob. 5SACh. 8 - Prob. 1AWCh. 8 - Prob. 2AWCh. 8 - Prob. 3AWCh. 8 - Prob. 4AWCh. 8 - Prob. 5AWCh. 8 - Prob. 6AWCh. 8 - Assume the following declarations appear in a...Ch. 8 - Design an algorithm for a function that accepts an...Ch. 8 - Write a pseudocode algorithm that uses the For...Ch. 8 - Total Sales Design a program that asks the user to...Ch. 8 - Lottery Number Generator Design a program that...Ch. 8 - Prob. 3PECh. 8 - Prob. 4PECh. 8 - Charge Account Validation Design a program that...Ch. 8 - Days of Each Month Design a program that displays...Ch. 8 - Phone Number Lookup Design a program that has two...Ch. 8 - Payroll Design a program that uses the following...Ch. 8 - Drives License Exam The local drivers license...Ch. 8 - Saddle Points Design a program that has a...Ch. 8 - Tic-Tac-Toe Game Design a program that allows two...Ch. 8 - Lo Shu Magic Square The Lo Shu Magic Square is a...
Knowledge Booster
Similar questions
- PYTHON CODE Write a PYTHON program that will take some string as an input and as well an array of integer that is the same length as the string. Following this, the string will be re-arranged such that the character at the nth position will move to the position n of the newly arranged string which is then returned to the user. For example: Example: Input string from user = “abc” and the array is [0, 1 , 2] Then the output is simply “abc”, each letter matches the correct position. Example: Input string from user = “aaiougrt” and the array is [4,0,2,6,7,3,1,5] Then the output will be “arigatou” Assume the user always enters a string and an array that are the same length, if there is a mismatch between the two lengths, simply continue to ask the user until they enter a string and array that are matching length.arrow_forwarddvvxarrow_forwardWrite a program that: Declare the following integer variables: Leftmotor Rightmotor Declare the following character arrays: lilac of size 50. - lea of size 30. Program 9 Repeat the steps below 10 times and then quit the program. Ask the user for a robot command and store it in a character array of size 50. Store the user input in lilac. The user input consist of up to two words inputted as one string. The motors are assigned values according to the string input and the table below. Also the input string could be one word or two words. If the first word is STOP then no further instruction is needed (no second word in the string). If the first word is move then a second word will follow First word Second word Left motor Right motor STOP 0 0 MOVE FORWARD 127 127 MOVE REVERSE -127 -127 MOVE MOVE LEFT RIGHT 64 127 127 64 The user input could be a mix of upper case and lower case letters so you need to change all the input to upper case before comparing with the instruction words.arrow_forward
- CODE USING C++ 3. Find the Culprit by CodeChum Admin "Help!!!" Someone's calling for help! It seems that someone was robbed and their phone was stolen. Luckily, the phone's GPS is turned on so we can track the culprit's coordinates! Instructions: Ask the user for the number of rows and columns of a 2D array and then its elements. Then, ask the user for another integer value which represents the culprit. Finally, go through the 2D array and find the culprit's coordinates - its row number and column number and display them. Input 1. Number of rows 2. Number of columns 3. Elements of the 2D array 4. Culprit's value Output Print the row of the position first and then the column of the position. Note that the row and the column is 0-based (i.e. it starts at 0 and not at 1). It is guaranteed that the culprit exists only once in the 2D array. Enter·#·of·rows:·4 Enter·#·of·columns:·4 Elements: 1·4·2·3 9·1·2·3 4·2·1·1 9·2·8·3 Enter·the·culprit's·value:·8…arrow_forward1. Given a string of at least 3 characters as input, if the length of the string is odd return the character in the middle as a string. If the string is even return the two characters at the midpoint. public class Class1 { public static String midString(String str) { //Enter code here } } ----------- 2. Given an array of integers return the sum of the values stored in the first and last index of the array. The array will have at least 2 elements in it public class Class1 { public static int endSum(int[] values) { //Enter code here } } ----------- 3. The method takes a string as a parameter. The method prints treat if the string is candy or chocolate (of any case, such as CaNdY) Otherwise print trick import java.util.Scanner; public class Class1 { public static void trickOrTreat(String str) { //Enter code here } public static void main(String[] args) { Scanner s = new Scanner(System.in); trickOrTreat(s.nextLine()); } }arrow_forwardcode itarrow_forward
- python Geography Grades 2Make a copy of your program for the problem Geography Grades 1 and change the code in such a way that your program nolonger prints the average grade, but the final grade.The final grade is calculated by rounding the average grade to the nearest multiple of a half. So, for example, a 7.2becomes a 7.0 and 7.3 becomes a 7.5. If this calculation results in a 5.5, the final grade becomes a 6.0.Your assignment is to make the report for the geography course of group 2b, that, with the same example input as forthe problem Geography Grades 1, should look like this:Report for group 2bAnne Adema has a final grade of 6.0Bea de Bruin has a final grade of 7.0Chris Cohen has a final grade of 7.5Dirk Dirksen has a final grade of 4.5End of report"""arrow_forwardGiven days "Friday","Saturday". Write a complete C program using an array that permits interaction with the user in this manner. Q5 "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", Example of output: Enter a Day Number : 3 The day name = Tuesday (5 marks)arrow_forwardfngdndndnn n dnnndnfnfnarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning