et of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 8.eh 6.0h 1.On 5. 5h 2.25h e.75h 2.25h 3.0h 3.en 5.75h 2.25h report could be produced by a program like this: 0.00h 0.00h 5.25h 1.50n 3.25h e.seh 10.e0h | 3.0en 6.00h 1.een 8.50h 8.25h 8.00h i 5.75h 2.25h e.00h | e.e0h 5.5eh 2.25h 0.75h 2.25h 3.00h 3.00h leekly Total: 40.00h otice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string.slicing, converting data pes, and string formatting.
Q: Create a program that calculate the following; • Total amount of sales in a specific day (X). •…
A: - We have to code the sales program for the input from the user.
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Program: n = int(input()) # variable n indicates number of integers which will followlist = [] # an…
Q: 1. Provide a value we could put in the blank so that the value of x will be 7 after the code…
A: The answer will be "22"
Q: A tic-tac-toe grid of size n is a grid composed of empty tiles bounded by solid lines. The grid is…
A: The following is the code with comments I tried to my best to comment as clear as possible.
Q: JAVA) Write a program that allows the user to enter the last names of five candidates in a local…
A: CODE:- import java.util.*;import java.text.NumberFormat; public class Main{ public static void…
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Given: When analyzing data sets, such as data for human heights or for human weights, a common step…
Q: C++ A robot is initially located at position (0; 0) in a grid [?5; 5] [?5; 5]. The robot can move…
A: The below given C++ program will obey the following rubrics: Including necessary header files.…
Q: JPNav is a program to help navigate people, telling them wether or not they can reach their…
A: A string in C is defined as a character array. The character array can be assigned a string value in…
Q: Suppose that x and y are of type int, z is of type double, and ch is of type char. Consider the…
A: Given:
Q: diy.h x +C Custom Input Output main.c Test Cases 1. DIY Pattern(from codeChum, modified) 1 int…
A: getNum() Method: #include<stdio.h> int getNum() { int n1,n2,n3,n4; scanf("%d",&n1);…
Q: Develop a program that will read the following marks as inputs:…
A: Here, Program instructions are given.
Q: Write a program that gives simple math quizzes. The program should display two randomnumbers that…
A: CODE:- import randomdef main(): #Program message print(" Math Quiz" )print("Enter the result of…
Q: tic-tac-toe grid of size n is a grid composed of empty tiles bounded by solid lines. The grid is…
A: In the following block I have pasted the code with comments. I request you to go through and run in…
Q: In Java: year in the modern Gregorian Calendar consists of 365 days. In reality, the earth…
A: import java.util.Scanner; public class Main{ public static void main (String[]args) { Scanner…
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: code:- lst = []num = int(input("Enter the size of the array: "))print("Enter array elements: ")for n…
Q: In each of the following code snippets, data is copied from x to y. How many bytes of data are…
A: Given Example(1): int x[10], y[10];...for (int i=0; i<10; i++)x[i] = y[i]; Example(2): int *x,…
Q: Write a program to calculate students' average test scores and their grades. You may assume the…
A: Solution: Given,
Q: java please Write a program that reads a list of words. Then, the program outputs those words and…
A: Programming instructions: Create a class. In the main method, take the required inputs from the…
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Program plan: Prompt for the value and append then in the list Now assign these numbers to a…
Q: The ancient Greeks classified numbers geometrically. For example, a number was called "triangular"…
A: A number is said to be a triangular number if the sum of the dots in the number is equal to the sum…
Q: Write a program that will allow a student to compute for his equivalent semestral grade. • The…
A: The answer is given below.
Q: Show the output of the following two programs: (a) def main():number = 0numbers = [10]m(number,…
A: Step 1:- a)Explanation:- 1.Declare the function main() a)initilaise the number=0 b)initilaise the…
Q: b. Using Data Encapsulation in Python, give the output of the Pseudocode below: class Computer: def…
A: As per our guidelines, we are supposed to answer only one question. I have answered two of your…
Q: (JAVA) Write a program that allows the user to enter the last names of five candidates in a local…
A:
Q: A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: I give the code in Python along with output and code screenshot and explanation
Q: n Python: Sites like Zillow get input about house prices from a database and provide nice summaries…
A: INPUT/OUTPUT:
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Below is the required C program: - Approach: - Define the header file. Define the main function.…
Q: The code must be in Java The program will ask the user to input the file name then read several…
A: import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import…
Q: n an ancient land, the beautiful princess Eve (or handsome prince Val) had many suitors. Being…
A: Step 1: Prompt and accept the number of suitors, n. Step 2: Iterate n times and add the suitors to…
Q: The formula log(N) = log(No) +t/T log(2) can be used to simulate this, where Ng is the original…
A: Without VB net we can calulate the value of T: The symbolic value is given as: Syms : T Then use…
Q: Write a program that reads integers, finds the largest of them, and counts its occurrences. Assume…
A: We have to write a program that reads integers, finds the largest of them, and counts its…
Q: 50. Consider the following pseudocode fragment, where X is an integer variable that has been…
A: Lets Check Option1: (i==10) OR (i==X) it means that when Loop will Terminate the value of i equal…
Q: 18. int x,y; x = 1 / 2; y = 3.0 / 2.0 double z, w, t; z = 1 / 2; w = 3 / 2 t = 3.0 / 2.0%; x = y =…
A: We are two codes where we are initialising variable with some values. We will have to find their…
Q: uppose we are developing a program that a car dealership can use to manage its inventory of used…
A: Below is the required java program. Program Approach: Create a class as Automobile. Inside an…
Q: 43) Review the given program below and answer the questions that follows. Vinclude int i, j; int…
A: answers:- 4.3 (a) the program is giving the sum of the first n natural numbers. example:- 3 is…
Q: 2. Series E by Jemar Jude Maranga Write a program that will print then items in the following…
A: I have written the correct code in C++ as an answer to this question in step 2. I have also provided…
Q: write in JAVA LANGUAGE Create a program that will compute PRELIM, MID-TERM, PRE-FINAL, FINALS GRADES…
A: Task : Collect the 3 quiz marks in Prelim Midterm Pre-Finals Finals Output the list of grades…
Q: 5.Encipher the word GO by grouping. For conversion of the alphabet to numbers, use A B C D E F G H I…
A: Given message is GO This is a plain text and the values of letters present in the message are; G-6…
Q: Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: We need to write a Python program for given scenario.
Q: (3) (a) A fair coin is flipped, if it lands on the head side, one dice is rolled and X is the…
A: a) A fair coin is flipped,if it lands on the head side,one dice is rolled and X is the resulted…
Q: Imagine you are working for a lumber company, and your employer would like a program that calculates…
A: The company sells pine, fir, cedar, maple, and oak lumber. The lumber is priced by board feet. One…
Q: Fitness Quotient Minimum Heart Rate Maximum Heart Rate Heart Rate Series 0.919 68 80 68, 69, 76, 78,…
A: Solution is provided step by step in the java language- Following is the code written in java for…
Q: Calculate and return the sum of two decimal numbers - getSum.
A: NOTE:“Since you have asked multiple questions, we will solve the first question for you. If you want…
Q: On July 16, 1969, the Apollo 11 spacecraft launched from Earth. Write out a program to simulate a…
A: Solution: I implemented the solution in Python-3 I also used the time module and time.sleep(sec)…
Q: Why am I getting errors? Says "Index 0 out of bounds for length 0"
A: Question- The Error you are getting simply the array args is empty. You have not passed any value to…
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: n = int(input()) data = [] for i in range(0, n): num = float(input()) data.append(num)…
Q: Write a program that records and displays league standings for a baseball league. The program will…
A: Here I have created functions with the same name as per the question. In the function…
Q: The Huntington High School basketball team has five players named Art, Bob, Cal, Dan, and Eli.…
A: The, code has given below:
Q: The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that…
A: Explanation: Include all the necessary header files. Declare the necessary variables. Take the user…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- DataFile.txt contains the information of poker cards. 1. C: clubs (lowest), D: diamonds, H: hearts, S: spades (highest) 2. 2 (lowest), 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A 3. No Joker cards 4. Any C cards are lower than any D cards. DataFile Content (You can write the file specification into your program.) : H4,C8,HJ,C9,D10,D5,DK,D2,S7,DJ,H3,H6,S10,HK,DQ,C2,CJ,C4,CQ,D8,C3,SA,S2,HQ,S8, C6,D9,S3,SQ,C5,S4,H5,SJ,D3,H8,CK,S6,D7,S9,H2,CA,C7,H7,DA,D4,H9,D6,HA,H10,S5,C10 H4, D5, HK, D2 H4, HK, SK C9,C10 1. Create a list by dynamic allocated array and set the size to 20 2. Read the first 20 cards in the first line of the file, the put them one by one into the list by implementing and using putItem(). The list must be kept sorted in ascending order. Then print out all the cards in the list in one line separating by commas. 3. Then delete the cards indicated in the second line of the file by using deleteItem() Then print out all the cards in the list in one line separating by commas. 4. Then put…Topical Information Use C++. This lab should provide you with practice in file handling, stream formatting, and some string manipulation. Classes might come in handy, too. Program Information Write a program that reads a list of enrollments from a file and prints a class roster for the teacher. Make the class roster line up as neatly as you can and still fit on the screen. You can choose the actual values to use for your data. Make sure to do enough sets of data to well test your program! (Empty data set, normal data set, data with large values, data with short values, etc.) Also, your program can't know ahead of time how many people are enrolled in the class... Don't forget to read the file's name from the user and protect your program against any errors that may occur during the opening of the file. Try to use functions to break up the program into more manageable pieces. As an example, you might have the data file contain: # name # student number # address1 # address2 # phone number…Jupyter Notebook Fixed Income - Certicificate of Deposit (CD) - Compound Interest Schedule An interest-at-maturity CD earns interest at a compounding frequency, and pays principal plus all earned interest at maturity. Write a function, called CompoundInterestSchedule, that creates and returns a pandas DataFrame, where each row has: time (in years, an integer starting at 1), starting balance, interest earned, and ending balance, for an investment earning compoundedinterest. Use a for(or while) loop to create this table. The equation for theith year's ending balance is given by: Ei =Bi (1+r/f)f where: Ei is year i's ending balance Bi is year i's beginning balance (note: B1 is the amount of the initial investment (principal) r is the annual rate of interest (in decimal, e.g., 5% is .05) f is the number of times the interest rate compounds (times per year) The interest earned for a given year is Ei - Bi Note the term of the investment (in years) is not in the above equation; it is used…
- Write in C++. Description: wzip and wunzip class overview: The next tools you will build come in a pair, because one (wzip) is a file compression tool, and the other (wunzip) is a file decompression tool. The type of compression used here is a simple form of compression called run-length encoding (RLE). RLE is quite simple: when you encounter n characters of the same type in a row, the compression tool (wzip) will turn that into the number n and a single instance of the character. Thus, if we had a file with the following contents: aaaaaaaaaabbbb the tool would turn it (logically) into: 10a4b The exact format of the compressed file is quite important; here, you will write out a 4-byte integer in binary format followed by the single character in ASCII. Thus, a compressed file will consist of some number of 5-byte entries, each of which is comprised of a 4-byte integer (the run length) and the single character. To write out an integer in binary format (not ASCII), you…8.11 LAB: Movie show time display Java Please Write a program that reads movie data from a csv (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the csv file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator (|) in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the csv file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the…Time remaining: 00:09:44 Computer Science A file containing data about some students' options regarding a set of optional subjects is given. The file is available in the resources section of laboratory 2. The file contains 10,000 lines, each student having 2 consecutive lines from the file. On the first line of the two is the name of the student and on the second is a series of 4 codes representing the same number of options. Knowing that there are a total of 5,000 students and that no student's name is longer than 35 characters, it is required: · Read the data in the file in an array of 5,000 elements of the form <name, optional1, optional2, optional3, optional4> · Knowing that the students are sorted alphabetically by name, to apply an optimal search algorithm, from those studied in this laboratory and to count the number of comparisons to find the student MATEI STEFAN. · Apply the linear search algorithm to locate all students who have chosen a particular option, given…
- [Python (py3)] The code below can already solve for matrix addition. Please add the code for matrix scalar multiplication. The input will come from file1.txt, and the output should be printed to output.txt Format of the input from file1.txt:First Line: type of operation (add or scalmultiply)Second Line: matrix A dimension (example: if 3 rows and 2 columns, type 3 2)Third Line: matrix A elementsFourth Line: matrix B dimension (or the scalar number for the operation of scalar multiplication)Fifth Line: matrix B elements (not needed for scalar multiplication)Sample input 1:scalMultiply2 253 -47 312Sample output 1:106 -814 62 ---------------------------------------------------------------------------------- import numpy as npimport sys f1 = open("file1.txt","r")lines = f1.readlines()dim = lines[1].split()k=2mat1 = np.empty((0,int(dim[0])), int)for i in range(0,int(dim[0])): l = lines[k].split() l = list(map(int, l)) ls = np.array([l]) k += 1 mat1 = np.append(mat1, ls,…Programming language: C/C++, Java, Python, or any other advanced programming languages Project Description: the file “IntegerArray.txt” included in this project folder contains all the 100,000 integers between 1 and 100,000 (inclusive) in some order, with no integer repeated. Your task is to compute the number of inversions in the file given, where the i-th row of the file indicates the i-th entry of an array. Because of the large size of this array, you should implement a divide-and-conquer algorithm.Please write Python code. Movie Recommendations via Item-Item Collaborative Filtering. You are provided with real data (Movie-Lens dataset) of user ratings for different movies. There is a readme file that describes the data format. In this project, you will implement the item-item collaborative filtering algorithm that we discussed in the class. The high-level steps are as follows: a) Construct the profile of each item (i.e., movie). At the minimum, you should use the ratings given by each user for a given item (i.e., movie). Optionally, you can use other information (e.g., genre information for each movie and tag information given by the user for each movie) creatively. If you use this additional information, you should explain your methodology in the submitted report. b) Compute similarity score for all item-item (i.e., movie-movie) pairs. You will employ the centered cosine similarity metric that we discussed in class. c) Compute the neighborhood set N for each item (i.e. movie).…
- C Programming What does the below code segment do? #define RECORD_LENGTH 60 /* PORTFOLIO.DAT looks like the below: ibm 108.77 27.98 att 111.43 50 acdc 100 30 */ void main(void) { FILE *fptr; char stock_price_shares[RECORD_LENGTH + 1]; int i=0, count=0; // attempt to open PORTFOLIO.DAT for reading if ((fptr = fopen("PORTFOLIO.DAT", "r")) == NULL) printf("\nCannot open the file: PORTFOLIO.DAT\n"); else { while ( fgets(stock_price_shares, RECORD_LENGTH + 1, fptr) != NULL ) printf("\n%s", stock_price_shares); fclose(fptr); //close the file } printf("\nHow many new records for PORTFOLIO.DAT?"); scanf("%d ", &count); fptr = fopen("PORTFOLIO. DAT", "w"); /* writing */ for (i = 0; i < count; ++i) { gets(stock_price_shares); fputs(stock_price_shares, fptr); fclose(fptr); } }IN C++, TRUE OR FALSE : The statement delete p; deallocates the dynamic array that is pointed to by p. In the statement cin >> y;, y can only be an int or double variable. In an output statement, the newline character may be part of the string. The extraction operator (>>) skips whitespace characters when searching for the next data in the input stream.C++ Progrmaing Instructions Redo Programming Exercise 6 of Chapter 8 using dynamic arrays. The instructions have been posted for your convenience. The history teacher at your school needs help in grading a True/False test. The students’ IDs and test answers are stored in a file. The first entry in the file contains answers to the test in the form: TFFTFFTTTTFFTFTFTFTT Every other entry in the file is the student ID, followed by a blank, followed by the student’s responses. For example, the entry: ABC54301 TFTFTFTT TFTFTFFTTFT indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9 (note the empty space). The exam has 20 questions, and the class has more than 150 students. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. Write a program that processes the test data. The output should be the student’s ID,…