digger. For vour task, you have been given a `map' of all the underground resources in the mine. This ma comes as a file. The file has n rows. Each row has n space-separated integers, Each integer is open-air program
Q: The program should have one class per .java file all calling to a main.java file using getters and…
A: In the given problem, we need to define different classes (named Employee, PayPeriod, TaxPayment and…
Q: Question: You are requested to develop a simple java program for a movie theatre. They need to store…
A: Program for the given code :- import java.util.*;import java.io.*; public class Main { public…
Q: Write a method named friendList that accepts a file name as a parameter and reads friend…
A: Answer:
Q: We have 6 objects of class taxi each objects is called randomly with random passengers now we have…
A: We have 6 objects of class taxi each objects is called randomly with random passengers now we have…
Q: This project assumes that you have completed Project 1. Place several Student objects into a list…
A: code " # import random to use random shuffle function.import random class Student(object):…
Q: Create a class MapTester (either in your current project or in a new project). In it, use a HashMap…
A: import java.util.HashMap; //class MapTester implementation class MapTester{ //hashmap for…
Q: Write a class Employee with name and salary. Create an ArrayList that sorts the Employees based on…
A: import java.util.*; public class test { // Employee class that imlements comparable interface…
Q: I have a code for an assignment, but the code isn't working please help me. The code of the…
A: The exception shown in the picture occurs when we try to access the file which is not available in…
Q: The Instructor class maintains, for a set of courses, the set of instructors for each course. Do not…
A: public void displayInstrPerCourse() { for (String key: map.keySet()) {…
Q: In Java: The CSV (or comma-separated values) format is commonly used for tabular data. Each table…
A: The java code and cvv file is
Q: Consider a scenario of Contacts Database, in which all information of user contacts will be stored.…
A: We will solve the given problem in Java language.
Q: In this project, you are going to introduce a Netflix-like (or Amazon prime…
A: The solution is given below:
Q: an ArrayList of ArrayLists
A: Given :- An ArrayList of ArrayLists is given in the above mention question and each inner ArrayList…
Q: As we have seen in lecture, a class provides a means to make code and data live (conceptually) in…
A: Answer: our instruction is answer the first three part from the first part and . I have given…
Q: rite a program that reads a text file and creates an alphabetical index of words and in which lines…
A: sentence = input("enter the sentence:") string = sentence.lower() print(string) count = 0…
Q: You are requested to develop a simple java program for a movie theatre. They need to store the…
A: The Complete code is given below with the outputs.
Q: Write a program that first gets a list of integers from input and puts them into a vector. The input…
A: I have provided C++ CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT-----------------
Q: Write import statements used in library.java
A: Write import statements used in library.java
Q: Please, can you help me? Thanks I'm working with notebook python. In the code cell below, create…
A: Import the networks module in your code. Select the file. Create the graph with certain parameters.…
Q: Write a method with the name "eraser" that will get two arguments: “maparr_plants" (Map array of…
A: Here we have to provide the key for containsKey and remove methods not the indices. So the updated…
Q: Write a declaration of a local variable called cs101 that can hold an ArrayList of Student.
A: ArrayList is a part of collection framework and is present in . It provides us dynamic arrays in…
Q: Write a class that maintains the top 10 scores for a game application, implementthe add and remove…
A: Singly Linked List · We have seen some applications of the arrays. · Arrays are…
Q: Write a program that prompts the user to enter apositive integer and displays all its smallest…
A: Let us consider a Java program that prompts the user to enter a positive integer and displays all…
Q: A for construct is a loop that goes over a list of objects. Consequently, it runs indefinitely if…
A: As A Consequence: Therefore or as a consequence is how you define consequently. The phrase "She…
Q: Write a program that uses an object of type ServiceRequests to keep track of customers that have…
A: File name: ServiceRequests.java import java.util.Scanner;import java.util.*;import…
Q: The array of Vehicles below, write the static method,findMin which returns the lowest price of any…
A: A static method that returns the lowest price is as follows, Code: //Define the method public static…
Q: JAVA Create a Map that can hold student IDs and student names. Add 6 students to the map. Test your…
A: 1) HashMap is used for storing data in key-value format. Syntax: HashMap<Key-type, Value-type>…
Q: In this project, you will implement a system, that is based on Linked List, to assign passengers to…
A: #include <stdio.h>#include <stdlib.h>#include <string.h> #include "linkedlist.h"…
Q: Create a class called MakeMap with a single static method called makeMap(). The method should take…
A: Java code for given problem :- import java.util.*;class MakeMap { public static…
Q: type date = {month int; day : int} For example, March 31st would be represented as {month = 3; day…
A: We need to check the invalid dates in predefined type for dates.
Q: Write a method called max that accepts a map whose keys are strings and whose values are integers as…
A: The code is below:
Q: we have 2 classes: public class Customer { private String id; private String name; private String…
A: Customer.java public class Customer { private String id; private String name; private String town;…
Q: This project's report requires you to plan your approach before you begin writing code, so read the…
A: Yes, it is possible. In the declaration section of the procedure, you can declare and define a…
Q: Write a method called flipMap() that takes in a map from string keys to string values, and returns a…
A: Actually, string is a sequence of characters.
Q: Question 6 Identify the time complexity of the following code. def printColors(colorlist,…
A: This question comes from Algorithm which is a paper of Computer Science. Let's discuss it in the…
Q: This example adds a class variable numberOfObjects to track the number of Circle objects created.
A: To make this happen, the static variable has to be incremented whenever we create an instance
Q: Challenge exercise Create a class called SortingTest. In it, create a method that accepts an array…
A: Since programming language not mentioned, using C++.
Q: Given a map pre-filled with student names as keys and grades as values, complete main() by reading…
A: Solution :
Q: I am trying to read a CSV file and then store it into an ArrayList. For each row, I'm trying to…
A: As we know that all the classes in java inherit the Object class, and also there are some methods of…
Q: Exercise 1 (Linear Search) Make a new Java Project called Lab6. Then create a new class called…
A: This Question is a simple Linear search implementation .In this question we have to find the…
Q: You are tasked to implement an abstract data type class which takes in a given input file called…
A: class ADTClass: def write(self,stringToWrite,startingIndex): file = open("input.txt","wt")…
Q: Write a program that uses an ArrayList of parameter type Contact to store a database of contacts.…
A: import java.util.ArrayList; import java.util.Scanner; public class Contact { String firstName;…
Q: Given main(), complete the SongNode class to include the printSonginfo() method. Then write the…
A: According to the information given:- We have to follow the instruction in order to get desired…
Q: Write a method called flipMap() that takes in a map from string keys to string values, and returns a…
A: Program approach-Import the essential java packagesDefine the main function.Declare the variables…
Q: public class BSTM, V>{ public BSTmn root; // Return the size of the map. public int size() { } //…
A: Answer is given below-
Q: In this project, you are going to introduce a Netflix-like (or Amazon prime…
A: Answer is given below.
Q: JAVA Write a METHOD named friendList that accepts a file name as a parameter and reads friend…
A: import java.io.File;import java.io.FileNotFoundException;import java.util.*;//class definitionpublic…
Java language
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- In this project, you will develop algorithms that find road routes through the bridges to travel between islands. The input is a text file containing data about the given map. Each file begins with the number of rows and columns in the map considered as maximum latitudes and maximum longitudes respectively on the map. The character "X" in the file represents the water that means if a cell contains "X" then the traveler is not allowed to occupy that cell as this car is not drivable on water. The character "0" in the file represents the road connected island. That means if a cell contains "0" then the traveler is allowed to occupy that cell as this car can drive on roads. The traveler starts at the island located at latitude = 0 and longitude = 0 (i.e., (0,0)) in the upper left corner, and the goal is to drive to the island located at (MaxLattitude-1, MaxLongitudes-1) in the lower right corner. A legal move from an island is to move left, right, up, or down to an immediately adjacent…Implement a program that identifies a person based on their DNA. $ python3 dna.py databases/large.csv sequences/5.txt Lavender [https://drive.google.com/drive/folders/1uEjrE0VNWG5HZYcmsMD8ZJUWgeW2whK6?usp=sharing]Download the file that you're going to use for this problem. Extract this file and you will see a directory of sample databases and a directory of sample sequences. Specification In a file called dna.py, implement a program that identifies to whom a sequence of DNA belongs. The program should require as its command-line argument that name of a CSV file containing the STR counts for a list of individuals and should require as its second command-line argument the name of a text file containing the DNA sequence to identify. If your program is executed with the incorrect number of command-line arguments, your program should print an error message of your choice. If the correct number of arguments are provided, you may assume that the first argument is indeed a filename of a…Write a program that receives a coded message file(Lab3ExtraCreditCT.txt) from your local espionage agent and decodes it into a file using standard English. The problem is your agent forgot to tell you the key used to decode the message. Fortunately, this is a simple substitution code consistently using 1 alphanumeric character to represent another, this is case sensitive. All other characters are not substituted, so a space will always be a space, a – will always be a –, a @ will always be a @, etcetera. You may use the following table to help you, it contains the most common letters used in the English language in descending order. E A R I O T N S L C U D P M H G B F Y W K V X Z J Q 0 5 3 2 4 6 8 1 9 7 Using the following key to convert plaintext to coded text: Plaintext = Now is the time for all good men to come to the aid of their country. Key = THEQUICKBROWNFXJMPSVLAZYDG The file your program outputs should look like this: Coded Text = Fxz bs vku vbnu ixp tww…
- , you will be writing a paython program for a company to load saved sales data from a file and view certain information about each customer. First, create a file in your project named sales.txt and add the following data: Steve123 11/23/21 50.41 Customer1 11/23/21 500 JanetG 1/2/22 25.37 Customer1 2/15/22 250 Steve123 3/17/22 18.75 UserName 4/12/22 2.50 FrankF 5/17/22 30 FrankF 6/10/22 42.50 JanetG 12/15/22 25 FrankF 1/23/23 50.15 Each line contains information about a single sale: The username of the customer, the date of the sale, and the amount of the sale. Aside from main, your program should include the following two functions: load_data: Creates a dictionary in which every key is a customer name, and every value is a list containing the amount of each of their sales. Returns the dictionary. print_customer_info: Accepts the dictionary and a customer name as parameters. Prints out the following information about the given customer in a nicely formatted way: the number of sales they…Write a program that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • Compute the average exam score of each student. • Assign a letter grade to each student based on the average exam score in the following scale: ◦ A: 90 =< x ◦ B: 80 =< x < 90 ◦ C: 70 =< x < 80 ◦ D: 60 =< x < 70 ◦ F: x < 60 • Output the first names, last names, exam scores, and letter…In Python IDLE Write a program that reads the file’s contents and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file The number of whitespace characters in the file Then the program should do a mass replacement of all spaces with a ‘-‘, and then replace any uppercase letters with lowercase letters. After the replacement of the spaces, the count of letters, digits, and spaces should be rerun, the number of replacements indicated, and a second report of letters, digits and spaces should be printed. Save the results of the changes in a file named “testoutput.txt”. This file must be submitted as part of the submission for your lab. Output should look like this: Uppercase letters: 20 Lowercase letters: 310 Digits: 4 Spaces: 82 >>> Hint: This program does not need to use any lists – the entire file can be read into one string. Problem 2. Date Printer - Write a program…
- Write a program in Python that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • Compute the average exam score of each student. • Assign a letter grade to each student based on the average exam score in the following scale: ◦ A: 90 =< x ◦ B: 80 =< x < 90 ◦ C: 70 =< x < 80 ◦ D: 60 =< x < 70 ◦ F: x < 60 • Output the first names, last names, exam scores, and letter grades of the students into a text file named…Suppose you have a file Monster.txt that lists the Monster Energy Drinks the company offers, on one line and the price for a case of 24, with the customer ratings on a scale of 1-5 on the second line. The following shows the first few lines of the file: Monster Energy Nitro Super Dry Maximum Strength Drink 39.99 4.5 Monster Energy Ultra Red, Sugar Free Energy Drink 39.99 5 Red Bull Energy Drink, Zero 92.23 4.5 Red Bull Energy Drink, Coconut Berry 41.18 5 Monster Energy Juice, Pipeline Punch 34.98 5 Red Bull Energy Drink, Coconut Berry 41.18 5 The first line means the drink name is: Monster Energy Nitro Super Dry Maximum Strength and the second line means that a case of 24 cost $39.99 and it was rated 4.5/5. NOTE: WE DO NOT KNOW HOW MANY LINES THERE ARE IN THE FILE. Write the C++ program (with comments) that reads the data from the file, lists only those drinks rated 5 stars, and indicates if the five star drink comes with a free six pack or not.The customer gets a free six…Write a program that reads student data from a file, compute their GPA and writes the results to a different file. 1. The user should have the option to either enter their text file that contains the student grades or use the provided text file that contains theinformation. The data in "indata.txt" should look similar to this, Lara_Croft75 70 91 69 89Chris_Redfield68 88 79 85 94Johnny_Cochran69 98 95 77 80Wanda_Maximoff84 86 98 95 92Luke_Skywalker74 96 80 98 97William_Kurt89 52 99 81 58Samuel_Jackson50 96 50 64 95END_OF_FILE This is supposed to be in python. This is what I have so far. I have no experience I apologise. I am trying to finish the GPA calculating program currently but am having trouble finishing it. grade = input("enter grades")points = 0 if grade is 90-99:total_points = 4.0if grade is 80-89:total_points = 3.0if grade is 70-79:total_points = 2.0if grade is 60-69:total_points = 1.0if grade is 50-59:total_points = 0.0gpa = total_points/len(grade)print(gpa,"is gpa")
- For this part in the assignment, you need to write a program in python that removes allinstances of a target element in a file named inputFile.txt. The user must enter the instance thatyou need to remove from that file. Once you received that instance, you need to check all thecontent in the inputFile.txt and remove that word. The result will be saved in another file calledoutputFile.txt. For example, if you received that the user wants to remove the word “and”, youneed to identify all the matches and remove them in the outputFile.txt document.Requirements: You should create the content in the inputFile.txt, please make them at leastwith ten lines or more. You could include poems, lyrics, news, etc. It is up to you. Also, youmust use functions to solve this part in the assignmentWrite a function in python named "read_words" that declares a parameter for a filename and returns a collection of unique words in the file. Even though words.txt contains a single word per line, you should not assume that this is true of every file. For example, if the line is a sentence, you should split the line into individual words before storing each word in your collection. Handle any errors that occur by printing a detailed error message. Hint: the Python set works like Java's HashSet.Write a program that reads the-zen-of-python.txt and writes each line to UpdatedZen.txt, a new text file. It capitalizes the first character of each line and adds a period to the end of each line before writing it back to updatedzen.txt. the-zen-of-python.txt file contents: beautiful is better than ugly explicit is better than implicit simple is better than complex complex is better than complicated flat is better than nested sparse is better than dense readability counts special cases aren't special enough to break the rules although practicality beats purity errors should never pass silently unless explicitly silenced in the face of ambiguity, refuse the temptation to guess there should be one-- and preferably only one --obvious way to do it although that way may not be obvious at first unless you're Dutch now is better than never although never is often better than *right* now if the implementation is hard to explain, it's a bad idea if the implementation is easy to explain, it…