line
Q: A derived class is more specific than its parent, or base class. True False
A: Explanation and Answer are given below:
Q: There are N frogs (numbered 1 through N) in a line. For each valid i, the i-th frog is initially at…
A: The question does not specify any particular programming language for the solution. We have done the…
Q: Which is the correct way to tell the compiler that the class being declared (ChildClass) is derived…
A: Inheritance is the capacity of a class to derive traits and properties from another class. One of…
Q: If c is a character variable that contains a digit, what does the following function return? int…
A: ASCII : ASCII (American Standard Code for Information Interchange) is a character encoding…
Q: To overload functions with symbolic names (like + -/<<), you must use the keyword before the…
A: In this question we need to choose correct keyword which is used before the symbolic name for…
Q: Problem 1 Use pandas to read Parking.csv and store the entire dataset as a DataFrame. Problem 2…
A: To use the Pandas library, we need to import it in our code. We can read a csv file using read_csv()…
Q: n the SELECT statement, the FROM clause is optional. TRUE/FALSE
A: SQL (Structured Query Language) is a quality programming language that helps in managing the…
Q: Given that the options for a set of radio buttons within the customOrder web form share the name…
A: the value of the color option selected by the user in the colorvalue variable by executing the…
Q: This is used to protect important data. OA) public access specifier O B) protect () member function…
A: In C++, access specifiers are keywords that determine the accessibility of class members (i.e.,…
Q: public static int cube(int num) { return num num num; What is the correct statement to pass value 8…
A: Function calls using the call by value method involve copying of the values of the actual parameters…
Q: For i = 1 to 100 step 1 Start Avg If is 100 chem1, chem2 chemi+chem2 2 If Avg > 70 Yes Grade = "A"…
A: Algorithm: 1. We declare integers 2. Then we pass integers into arrays 3. For i = 0 To 2 Step 1 4.…
Q: Question 33 Which of the following would be considered configuration tasks? Check all that apply O…
A: 33.Configuration Tasks: configuration tasks that apply to many different scenarios. It highlights…
Q: Q. 8 An AB flip-flop (FF) is constructed from a JK-FF as shown in the figure. The expression for the…
A: Introduction
Q: A member function that allow the user of the class to change the value in a data member is known as…
A: Introduction Member function: Operators and functions which are designated as members of a class are…
Q: Show the first pass of sorting the following array-based binary tree max-heap. In other words, show…
A: The answer is given below:-
Q: Class declarations are usually stored here. A) in .cpp files, along with function definitions OB) in…
A: In C++, a class is a user-defined type or data structure that is declared with the keyword class.…
Q: main.py x 12345 6 69 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 print ("List of pets")…
A: I have made the code error free and with proper indentation The complete PYTHON code is given below…
Q: The code has an extra 11 on the 2nd row which doesn't match the question
A: The updated code is given below for the above given question:
Q: Given the following class, what would be the best declaration for a constructor that would allow the…
A: In C++, a constructor is a special member function of a class that is called when an object of…
Q: Given the following class definition, what is missing? class ItemClass { public: ItemClass(int…
A: A default constructor is a constructor that sets the class's properties to some default values…
Q: In the following statement: class car public vehicle is the base class. OA) vehicle OB) public O C)…
A: Introduction : In object-oriented programming, a base class, also known as a superclass or a parent…
Q: 16. There are 23, 765 number of relations on the set {a, b, c, d}that contain the pair (a, a)?
A: False.
Q: 10 If the Year of Hire is 2003, insert the value from cell M2, If the Year of Hire is 1996, insert…
A: In cell S15 you need to enter the below formula -…
Q: To format a number stored in the variable x using the local standards for displaying numeric values…
A: to format a number stored in the variable x using the local variable for displaying numeric value
Q: Friend functions are members of the class. True False
A: In C++, a friend function is a function that is not a member of a class, but has access to the…
Q: For the function f: RxN-RxN defined as f(x.y)) = (3xy, y) Which of the following options is correct…
A: Introduction :Given , Function f : R * N -> R * N f((x,y)) = (3xy , y )We have to analyze given…
Q: This directive is used to create an "include guard," which allows a program to be conditionally…
A: This directive is used to create an "include guard," which allows a program to be conditionally…
Q: How about this 3) Prompt the user to search for the student id by the student's name.
A: #include <stdio.h>#include <string.h>#include <stdlib.h>// create struct for…
Q: Use a TEXTEQU expression to redefine “proc” as “procedure.”
A: TEXTEQU directive: The TEXTEQU directive is used to assign a name to a sequence of characters.…
Q: The constructor function always has the same name as OA) the first object of the class OB) the first…
A: The constructor always has the same name as the class. This is irrespective of the programming…
Q: fun main( ) { val = Girl() maria.actualAge = 60 maria.age println("Mery: actual age = println("Mery:…
A: the code is
Q: Select the correct option for the question show
A: Which of the following function declarations will correctly pass an output stream to the function?A)…
Q: Given the following class and object declaration, how would you print out the age and cost of a…
A: We can print the age and cost of a bottle of wine like:
Q: Examples of access specifiers are the key words: OA) private and public OB) opened and closed OC)…
A: We need to choose keywords to represent access specifiers.
Q: In a class, all members are OA) private OB) public OC) global OD) protected by default.
A: A class is a user-defined type or data structure declared with a keyword class with data and…
Q: A class member function that automatically initializes the data members of a class is called A) an…
A: 1. The process of creating a set of instructions that tells a computer how to perform a task is…
Q: Question-3) Develop a Form application that reverses a number entered by the user (For example, the…
A: here have to code program to reverse number.
Q: This is automatically called when an object is destroyed. A) specification deallocator OB)…
A: Function:- A function is a set of instructions that takes inputs, performs a set of operations on…
Q: What is wrong with the following member function definition given the class below? class Rational {…
A: 1) Program in question creates a class Rational with Private member variables numerator and…
Q: A web form that allows users to select one of three pizza crust choices from a drop-down menu would…
A: a web form that allow user to select one of three pizza crust choices from a drop down menu
Step by step
Solved in 2 steps
- Task: Loading data from files This exercise will require you to load some information from files and use it in your program. scene.txt contains a description of a series of shapes and colours to draw. You need to write code to read in the file data and draw the requested shapes in the correct colour. Each line in scene.txt will contain one of the following starting keywords followed by some data: COLOUR followed by 3 values: R, G, B CIRCLE followed by 3 values: X, Y, RADIUS RECT Followed by 4 values: X, Y, W, H LINE Followed by 4 values: X1, Y1, X2, Y2 CIRCLES are defined from the center. RECT's are defined from the top left. All values are space separated, and you can assume all input is correct (no errors). Please solve this program to draw the scene. I can't upload the file scene.txt, so I decide to screenshot a file for you. Subject: Java ProgrammingIn the input file (see image), grades are listed for the geography tests of group 2b. There have been three tests of which the grades will be included in the half-yearly report that is given to the students before the Christmas break. On each line of the input you can find the name of the student, followed by one or more under scores (’_’). These are succeeded by the grades for the tests, for example: Anne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The lowest grade possible is a 1, the highest a 10. If somebody missed a test, the grade on the list is a 1. The assignment is to make the report for the geography course of group 2b, which should look like this: Report for group 2bAnne Adema has an average grade of 5.5Bea de Bruin has an average grade of 7.2Chris Cohen has an average grade of 7.3Dirk Dirksen has an average grade of 4.6End of report Use functions to structure the code in Python.This list attached below is a chronological list of the World Series winning teams from 1903 through 2009. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. Note the World Series was not played in 1904 or 1994.) Write a python program that lets the user enter the name of a team, then displays the number of times that team has won the World Series in the time period from 1903 through 2009. Boston Americans New York Giants Chicago White Sox Chicago Cubs Chicago Cubs Pittsburgh Pirates Philadelphia Athletics Philadelphia Athletics Boston Red Sox Philadelphia Athletics Boston Braves Boston Red Sox Boston Red Sox Chicago White Sox Boston Red Sox Cincinnati Reds Cleveland Indians New York Giants New York Giants New York Yankees Washington Senators Pittsburgh Pirates St. Louis Cardinals New York Yankees New York Yankees Philadelphia Athletics Philadelphia Athletics St. Louis Cardinals New York Yankees New York…
- File names: color_square.py, chessboard.py, test_squares.py Positions on a chess board are identified by a letter and a number. The letter identifies the column; the number identifies the row. See the image below. You will provide the functions that allow us to determine: if a chessboard square is either black or white, given its coordinates. If the row/column is valid or not for the standard chessboard For example, if we pass in “d” for the column and 4 for the row, your function that determines color should return the string: “BLACK”. If we pass in "k" for the column to your function that validates columns, that function should return the boolean False. Requirements: Your function for validating the column should be able to accept upper or lowercase strings as parameters. Your functions for validating the row should be able to accept integers or strings as parameters. Your function that determines black-or-white may assume that the input has been validated prior to us calling…2. The manager of a basketball stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets – box, sideline, premium, and general admission. After each game, data is stored in a file in the following forms: ticketPrice numberOfTicketsSold Sample data are shown below: 250 5750 100 28000 50 35750 25 18750 The first line indicates that the box ticket price is 250 pesos and that 5750 Tickets were sold at that price. Output the number of the tickets sold and the total sale amount. Format your output with two decimal places.O kgeme: ot Co htioseeningodmataorkconlaundh Readng r Excel File I/O The attached Distances xlsx file contains a spreadsheet with the pairwise distances in mies of the top 100 US cities by population. A preview of the spreadsheet is shown below. The first row and first column contain the city names using the following format: city name comma space capitalized state abbreviation, e.g, Nashville, TN. Note that the very first cell of the spresheet, A1, is blank. Write a function called get_distance that accepts two character vector inputs representing the names of two cities. The functian returns the distance between them as an output argument called distance. For example, the cali get_distance('Seattle, WA', Miami, FL') should return 3723. If one ar both of the specified cities are not in the file, the function returns 1. Your function should load the data only once. File VO is a time consuming operation. Loading the date multiple times is will likely cause a time-out error when…
- Java languageAir Pacific Limited, Fiji's international airline, operates international and domestic services around the Pacific and to North America and Hong Kong. It has its head office at the Air Pacific Maintenance & Administration Centre in Nadi. You are required to write a program that passengers can use to chose seats for aircraft FJ501. The aircraft has 13 rows with 5 seats in each row. Rows 1 to 4 are first class, the remaining rows are economy class. The program should display the seating plan for the aircraft. Empty seats are shown with x and the seats that are booked will have the passenger name (first name plus initials of other names) on it. To reserve a seat, they have to provide their ticket type (First Class or Economy Class), the seat they prefer and their name (first name plus initials of other names). The program verifies that the seat is empty then only bookings are done. Passengers are also allowed to check the seats they are booked for by providing the passenger name (first…Here are the two programs which you may choose from to do this program: 1. Using Files - Student Line Up Modify the Student Line Up program described in Programming Challenge 14 which states: "A teacher has asked all of her students to line up according to their first name. For example, in one class Amy will at the front of the line, and Yolanda will be at the end. Write a program that prompts the user to enter the number of students in the class, then loops to read that many names. Once all of the names have been read, it reports which student would be at the front of the line and which one would be at the end of the line. You may assume that no two students have the same name. You are now to do this program reading names from a file. Names should be read in until there is no more data to be read. I am providing for you a file named LineUp.txt for you to use in writing this program. I suggest that you write it first without the file and then modify to add the file.
- Section: Algorithm 7. s] A transport consultant has created a file of information about trips collected from individuals who have participated in a survey. This information includes start_time and end_time variables. One of the items contained in the file is the duration of each trip (that is, end_time – start_time) in minutes. The consultant is trying to work out how to calculate the number of trips with duration greater than 60 minutes (that is, how many trips take longer than an hour) and requires your assistance to develop an algorithm. You can assume that the durations are read one at a time and should only be read until EOF (end of file) is reached. i. ] *Develop a flowchart to show your algorithm, using the diagrammatic conventions described in the lecture. s] What is the likely complexity of your program using big-O notation? ** 11. Clearly point out what the primary parameters are and define your terms.This program reads the text file created in the program above and displays its data. Use f-strings to create a table of rows and columns with column headings as follows: PLAYER COLUMN: 10 characters wide and left-aligned. GOALS COLUMN: 6 characters wide and centered. ASSISTS COLUMN: 8 characters wide and centered. TOTAL COLUMN: 6 characters wide and centered. After printing the stats for each player, the program should report the name of the top scorer and his total points (goals + assists).Python Please! Create a program that will allow a user to do either of the following things: Get input from the user to write the following information to a file: Student name Assignment average grade Mid-term test grade Fi-nal project grade Fi-nal test grade Allow the user to search the file by student name and output a weighted average (15%, 25%, 25%, and 35%, respectively) based on the grades for that student in the file. The user should be able to choose either of the two options until they want to stop.