Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
8.7 (Converting Strings to Integers for Calculations) Write a program that inputs six strings t hat represent integers, converts the strings to integers, and calculates the sum and average of the six values.
Solve the problem step by step in c without using pointers
And Make sure to provide the text based code too
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 6.20 Word count (c++) using (#include<fstream>) Write a program that prompts the user to input the name of a text file and then outputs the number of words in the file. You can consider a "word" to be any text that is surrounded by whitespace (for example, a space, carriage return, newline) or borders the beginning or end of the file.Input Notes: There are two input sources in this program: the text file and standard input. The standard input consists of a single word, the name of the text file to be read. DO NOT USE A STRING VARIABLE.Output Notes (Prompts and Labels): The filename provided in standard input is prompted for with "Enter a file name: " and displayed so that the filename entered is on the same line as the prompt.The output of the program is a single line of the form: "The file contains N words." where N is the number of words determined by the program.arrow_forwardQ1) List (with elaboration) all the components that a machine should contain in order to be classified as “Robot”?Q2) What is the purpose of NumPy in Python? Write a NumPy program to test if any of the elements of a given array are non-zero.arrow_forward5.10 (Find numbers divisible by 5 and 6) Write a program that displays all the numbers from 100 to 1,000, ten per line, that are divisible by 5 and 6. Numbers are separated by exactly one space.arrow_forward
- 2.13 LAB: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f} {:.2f} {:.2f}'.format(your_value1, your_value2, your_value3)) Ex: If the input is: 20.0 3.1599 Then the output is: 3.16 11.85 79.00 Note: Real per-mile cost would also include maintenance and depreciation. 318650.2047284.qx3zqy7 LAB 2.13.1: LAB: Driving costs 0/10 ACTIVITY main.py Load default template...arrow_forwardMay I get the solution of the attached exercise, I am stuckarrow_forward5.27 LAB: Sum of products (JAVA) Write a program in java that reads two lists of integers from input into two arrays and outputs the sum of multiplying the corresponding list items. The program first reads an integer representing the length of each list, followed by two lists of integers. Ex: If the input is: 3 1 2 3 3 2 1 the program calculates (1 * 3) + (2 * 2) + (3 * 1) and outputs 10 Ex: If the input is: 4 2 3 4 5 1 1 1 1 the program calculates (2 * 1) + (3 * 1) + (4 * 1) + (5 * 1) and outputs 14 Code starts here: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int size; size = scnr.nextInt(); int[] listA = new int[size]; // List A int[] listB = new int[size]; // List B /* Type your code here. */ }}arrow_forward
- 6.34 LAB: Contact list C++ A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: 3 Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 Your program must define and call the following function. The return value of GetPhoneNumber is the phone number associated with the specific contact name.string GetPhoneNumber(vector<string> nameVec, vector<string> phoneNumberVec, string contactName) Hint: Use two vectors: One for the string names, and the other for the string phone numbers.arrow_forward5.10 LAB: User-Defined Functions: Step counter CORAL LANGUAGE PLEASE A pedometer treats walking 2,000 steps as walking 1 mile. Define a function named StepsToMiles that takes an integer as a parameter, representing the number of steps, and returns a float that represents the number of miles walked. Then, write a main program that reads the number of steps as an input, calls function StepsToMiles() with the input as an argument, and outputs the miles walked. Output the result with four digits after the decimal point, which can be achieved as follows:Put result to output with 4 decimal places If the input of the program is: 5345 the function returns and the output of the program is: 2.6725 Your program should define and call a function:Function StepsToMiles(integer userSteps) returns float numMilesarrow_forward6.37 LAB: Multiples of ten in a vector Write a program that reads a list of integers, and outputs whether the list contains all multiples of 10, no multiples of 10, or mixed values. Define a function named IsVectorMult10 that takes a vector as a parameter, representing the list, and returns a boolean that represents whether the list contains all multiples of ten. Define a function named IsVectorNoMult10 that takes a vector as a parameter, representing the list, and returns a boolean that represents whether the list contains no multiples of ten. Then, write a main program that takes an integer, representing the size of the list, followed by the list values. The first integer is not in the list. Ex: If the input is: 5 20 40 60 80 100 the output is: all multiples of 10 Ex: If the input is: 5 11 -32 53 -74 95 the output is: no multiples of 10 Ex: If the input is: 5 10 25 30 40 55 the output is: mixed values The program must define and call the following two functions. IsVectorMult10…arrow_forward
- 5.19 LAB: Adjust list by normalizing When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain less than 20 floating-point values. For coding simplicity, follow every output value by a space, including the last one. And, output each floating-point value with two digits after the decimal point, which can be achieved as follows:printf("%0.2lf ", yourValue); Ex: If the input is: 5 30.0 50.0 10.0 100.0 65.0 the output is: 0.30 0.50 0.10 1.00 0.65 The 5 indicates that there are five floating-point values in the list, namely 30.0, 50.0, 10.0, 100.0, and 65.0. 100.0 is the largest value in the list, so each value is divided by 100.0.…arrow_forward5.13 LAB: Acronyms C++ An acronym is a word formed from the initial letters of words in a set phrase. Define a function named CreateAcronym that takes a string parameter and returns the acronym of the string parameter. Append a period (.) after each letter in the acronym. If a word begins with a lower case letter, don't include that letter in the acronym. Then write a main program that reads a phrase from input, calls CreateAcronym() with the input phrase as argument, and outputs the returned acronym. Assume the input has at least one upper case letter. Ex: If the input is: Institute of Electrical and Electronics Engineers the output should be: I.E.E.E. The program must define and call a function:string CreateAcronym(string userPhrase) Hint: Use isupper() to check if a letter is upper case. I try the function void CreateAcronym (char [], char[]). I need another solution with string CreateAcronym(string userPhrase). Appreciate it so much if you can solve it. #include…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education