C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 14, Problem 14.4E
Program Plan Intro
Program plan:
- The assending() is used to organize and print array in ascending order.
- Declare the variable i, j and temp of integer type in main().
- The desending() is used to organize and print array in ascending order.
- Declare the variable i, j and temp of integer type in main().
- The main() is used to input array and function call.
- Declare the variable i, n and array of integer type in main().
Program description:
The following program will take command line argument -a or -d from user and sort the array of integers in ascending or descending order.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(IN THONNY/PYTHON CODE)
design an application for the ABC Company that will process inventory from a file called ABC_Inventory.txt (attached to this assignment). The file contains Item ID, Description and list price stored on a separate line in the file. The program should display the contents of each record and then calculate and display the average list price. In python!
ABC_INVENTORY
BP25003-PERSON TENT75.0BP1000LOUNGE CHAIR50.0BP3000PROPANE HEATER149.0BP0900HIKING BOOTS120.0BP0950BACKPACK100.0BP3050GPS TRACKER130.0
(Sort three numbers) Write the following function to display three numbers in increasing order:
def displaySortedNumbers(num1, num2, num3):
Write a test program that prompts the user to enter three numbers and invokes the function to display them in increasing order. Here are some sample runs:
(Phone key pads) The international standard letter/number mapping found on the
telephone is shown below:
100
2 abc
3 def
4 ghi
5 ikl
6mno
7pgrs
8 tuv
9wxyz
Write a program that prompts the user to enter a letter and displays its correspond-
ing number.
Chapter 14 Solutions
C How to Program (8th Edition)
Ch. 14 - (Variable-Length Argument List: Calculating...Ch. 14 - (Printing Command-Line Arguments) Write a program...Ch. 14 - Prob. 14.4ECh. 14 - (Signal Handling) Read the documentation for your...Ch. 14 - (Dynamic Array Allocation) Write a program that...Ch. 14 - (Command-Line Arguments) Write a program that...Ch. 14 - Prob. 14.8E
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
- (Count the letters in a string) Write a function that counts the number of letters in a string using the following header: def countLetters(s) : Write a test program that prompts the user to enter a string and displays the number of letters in the string. the answer should be in python.arrow_forward(Python matplotlib or seaborn) CPU Usage We have the hourly average CPU usage for a worker's computer over the course of a week. Each row of data represents a day of the week starting with Monday. Each column of data is an hour in the day starting with 0 being midnight. Create a chart that shows the CPU usage over the week. You should be able to answer the following questions using the chart: When does the worker typically take lunch? Did the worker do work on the weekend? On which weekday did the worker start working on their computer at the latest hour? cpu_usage = [ [2, 2, 4, 2, 4, 1, 1, 4, 4, 12, 22, 23, 45, 9, 33, 56, 23, 40, 21, 6, 6, 2, 2, 3], # Monday [1, 2, 3, 2, 3, 2, 3, 2, 7, 22, 45, 44, 33, 9, 23, 19, 33, 56, 12, 2, 3, 1, 2, 2], # Tuesday [2, 3, 1, 2, 4, 4, 2, 2, 1, 2, 5, 31, 54, 7, 6, 34, 68, 34, 49, 6, 6, 2, 2, 3], # Wednesday [1, 2, 3, 2, 4, 1, 2, 4, 1, 17, 24, 18, 41, 3, 44, 42, 12, 36, 41, 2, 2, 4, 2, 4], # Thursday [4, 1, 2, 2, 3, 2, 5, 1, 2, 12, 33, 27, 43, 8,…arrow_forward[Python (py3)] Displayed below is an incomplete code for matrix addition, scalar multiplication, and multiplication. Please modify the code below such that: When "add" is read from the input from file1.txt, matrix addition will be performed. When "scalarMultiply" is read from the input from file1.txt, matrix scalar multiplication will be performed. When "multiply" is read from the input from file1.txt, matrix multiplication will be performed. The result for the called matrix operation is printed to output.txt. Sample input 1:add2 353 -4 17 31 22 3 67 2 2-34 6 3 Sample output 1:120 -2 3-27 37 5 Sample input 1.1:add2 2 53 -47 312 367 2 1-34 6 2 Sample Output 1.1:Matrix addition cannot be performed; dimensions are unequal. ________________________________________________________________________________ Sample input 2:scalMultiply2 253 -47 312Sample output 2:106 -814 62 _______________________________________________________________________Sample input 3:multiply3 3 34 10 37 8 346 2 123…arrow_forward
- (Python) Write code that does the following: opens the number_list.txt file, reads all of the numbers from the file (1 to 100) and displays them, then closes the file.arrow_forward("View all employees" function) If users click "View all employees" ( call program:view_employee.php), your program should(i) Retrieve all employees from TECH3740. EMPLOYEE table and list all employees in HTMLTABLE format(ii) If the salary is NULL, print it in red color.(iii) If Gender='M', print it in blue color. If Gender='F', print it in red color.(iv) Display the average salary of listed employees at the bottom of the employee table.(v) A statement "There are # employee(s) in the database." should be displayed above theemployee table, where # is the number of employees.arrow_forwardplease quickly thanks ! use Pythonarrow_forward
- . (True/False): A segment selector points to an entry in a segment descriptor tablearrow_forward(java programming language) Write a program to read and store four student’s 21SP registered course and their grade point, sortthem into an order their 21SP registered course, based on grade point from the smallest to the largest,then print them out. The student’s 21SP registered course and their grade point values should be typedin by the user in response to a prompt message. Save the file as SortCourse_yourID.javaarrow_forward(Display a pattern) Write a program that displays the following pattern:JJ aaa v vaaaJ J aa v v a aJ aaaa v aaaaarrow_forward
- (C Language) A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Assume also the maximum number of characters of all file names is 100.arrow_forward(Financials: currency exchange) Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Rupees PKR. Prompt the user to enter 0 to convert from U.S. dollars to Rupees PKR and 1 to convert from Rupees PKR and U.S. dollars. Prompt the user to enter the amount in U.S. dollars or Rupees PKR to convert it to Rupees PKR or U.S. dollars, respectively. Use c++ program.arrow_forward(Same-number subsequence) JAVA Class Name: Exercise22_05 Write an O(n) program that prompts the user to enter a sequence of integers ending with 0 and finds the longest subsequence with the same number. Sample Run 1 Enter a series of numbers ending with 0:2 4 4 8 8 8 8 2 4 4 0The longest same number sequence starts at index 3 with 4 values of 8 Sample Run 2 Enter a series of numbers ending with 0: 34 4 5 4 3 5 5 3 2 0 The longest same number sequence starts at index 5 with 2 values of 5arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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