Concept explainers
(Display three cards) Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 14 Solutions
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Additional Engineering Textbook Solutions
Mechanics of Materials (10th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
SURVEY OF OPERATING SYSTEMS
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out With Visual Basic (8th Edition)
Degarmo's Materials And Processes In Manufacturing
- C++ Coding: Arrays Implement a 4x4 two-dimensional array of integers. Use a nested loop to populate the array with random values 0 to 100 inclusive. Use a nested loop to output the array as a grid. Use a single loop to output all elements in the third row. Use a single loop to output all elements in the first column. Use a single loop to output all elements in the first diagonal (r==c). Use a single loop to output all elements in the opposing diagonal. Example Output: 10 75 67 8820 66 55 4831 57 93 3943 76 81 71Row 3: 31 57 93 39Col 1: 10 20 31 43Diagonal 1: 10 66 93 71Diagonal 2: 88 55 57 43arrow_forwardC++ Coding: Arrays Implement a 4x4 two-dimensional array of integers. Use a nested loop to populate the array with values 20 to 35 inclusive. Use a nested loop to output the array as a grid. Use a single loop to output all elements in the second row. Use a single loop to output all elements in the third column. Use a single loop to output all elements in the first diagonal (r==c). Use a single loop to output all elements in the opposing diagonal. Example Output: 20 21 22 2324 25 26 2728 29 30 3132 33 34 35Row 2: 24 25 26 27Col 3: 22 26 30 34Diagonal 1: 20 25 30 35Diagonal 2: 23 26 29 32arrow_forwardIn python please! I am strugglingarrow_forward
- 1) You are given the following input list. inputList = [['April','Bill','Cindy','Dave'], ['123 Main St.', '456 Oak St.', '234 Oak St.', '78 Maple St.'], [12,34,56,11],[11,2,5,12],[6,5,4,13]] Produce the following output list from the input list. [('April', '123 Main St.', 29), ('Bill", '456 Oak St.', 41), ('Cindy', '234 Oak St.', 65), ('Dave', '78 Maple St.', 36)] April, Bill, Cindy, and Dave are students. The second sub list contains their addresses. The three following sub lists contain their test scores. The test scores of a student are determined by their positions in the list. For example, April's total score is 12+11+6 = 29. Your code must work if I add more students and more tests to the input list. (10 points) 2) Define a function called encrypt that encrypts an input string and returns the encrypted string. It reverses the first half and the second half of the input string as follows. print(encrypt(")) print(encrypt('a')) print(encrypt('ab')) print(encrypt('abcd')) print…arrow_forwardHelp with code pleasearrow_forward3) Implement the if __name__ == "__main__" : block at the bottom of this file to do the following: 3a) The if main block at the bottom should get the name of the highway graph file from the command line arguments. See the video in Python that explains how to get command line arguments. 3b) Call your parse_highway_graph_file function to parse that file, and to construct a WeightedGraph object from it. 3c) Write some code that outputs (with print statements) the degree of each vertex. You can have one vertex per line, indicating its id (just its 0-based index) followed by its degree. IMPORTANT: Your parse_highway_graph_file function should NOT produce any output. You will have code in your if main block that will have the print statements. The WeightedGraph class has a degree method, inherited from Graph that will return to you the degree of a vertex.arrow_forward
- Problem Attachedarrow_forward*Code in Python Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. The input file can contain one or more sentences, or be a multiline list of words. An example input file is shown below: example.txt the quick brown fox jumps over the lazy dog An example of the program's output is shown below: Enter the input file name: example.txt brown dog fox jumps lazy over quick thearrow_forwardGirlNames.txt This file contains a list of the 200 most popular names given to girls born in the United States from the year 2000 through 2009. BoyNames.txt This file contains a list of the 200 most popular names given to boys born in the United States from the year 2000 through 2009. Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application will display messages indicating whether the names were among the most popular. **programming language is python** ** must use a def main(): function** *please include some comments* i aslo have the .txt files but no wya to upload themarrow_forward
- 3 نقاط * To plot two curves on the -:same figure area (hold on) is the command used between two plot statements. a loop that runs two times is used. the number (2) is placed before the command (plot). the command (clc) is used between two plot statements. a two dimensional matrix is used. هذا السؤال مطلوب Darrow_forwardPython - Next Birthdate In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next. Create a function with the following signature: nextBirthdate(filename, date) filename: parameter, which represents the CSV filename. date: parameter, which represents the current date. The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next. Sample Run birthdates.csv Draven Brock, 01/21/1952 Easton Mclean, 09/02/1954 Destiny Pacheco, 10/10/1958 Ariella Wood, 12/20/1961 Keely Sanders, 08/03/1985 Bryan Sloan,04/06/1986 Shannon Brewer, 05/11/1986 Julianne Farrell,01/29/2000 Makhi Weeks, 03/20/2000 Lucian Fields, 08/02/2018 Function Call nextBirthdate("birthdates.csv", "01/01/2022") Output…arrow_forwardcreateDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles. 2. Reads the profiles from the input file. 3. For each person in the file 1. creates a Profile object with the information from file (see input file format below). 2. insert the newly created profile into the next position in the database array (instance variable).arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage