(Address book) Write a program that stores, retrieves, adds, and updates addresses as shown in Figure 17.20. Use a fixed-length string for storing each attribute in the address. Use random access file for reading and writing an address. Assume that the size of name, street, city, and zip is 32, 32, 20, 2, 5 chars, respectively
Q: Write a program to calculate the Factorial of a 5 using a recursive function. Attach the output file…
A: Below is the required code in C++ language. Program Approach: Include necessary header files and…
Q: State whether the following are true or false. If the answer is false, explain why.b) Pointers of…
A: Given:- Pointers of different types may not be assigned to one another without a cast operation.
Q: 3. Use a trace table to show what is the output of the following program? #include using namespace…
A: As per the policy we are required to answer only one question.Solution for question 3 is as…
Q: st, and pointers shall be used in this program. Kindly use only SELECTION, ITERATION, INPUT, AND…
A: #include<iostream> #include<fstream> #include<windows.h> #include<string>…
Q: 3.1 Files can be used to store data permanently. a. List and describe the two types of files that…
A: File handling in C++ is a mechanism to store the output of a program in a file and help perform…
Q: In c++ , perform data traversal before and after deletion operation. ( Drop code in words , explain…
A: Here is the program to perform data traversal before and after deletion operation in Data Structure…
Q: omputer Science Perl Questions Explain what this code is doing: “if(/[a-z]/) { print; } else {…
A: Answer:
Q: 2. Printing binary Write a function void printBin(int value) that will print an integer as a binary…
A: Print binary representation of a given number in C, The idea is to check if i'th bit is set for each…
Q: 1. Write a program that performs arithmetic division. The program will use two integers, a and b…
A: Declare variables a, b and c for division Take inputs from user Print the result
Q: 10.25 LAB: Quadratic formula Implement the quadratic_formula() function. The function takes 3…
A: The above code is solved using Python Language below:
Q: 2. Given the same initial statements s1 = [2,1,4,3] s2 = ['c','a','b'] show the values of s1 and s2…
A: The problem is based on the basics of lists in python programming language.
Q: 2. Write and test two functions, encode(text, key) and decode(code, key), that implement a…
A: #function that will encrypt the file contentdef encode (plainfilename, key): #declaring the…
Q: 4. Write pseudo code that will perform the following. a) Read in 5 separate numbers and calculate…
A: Required:
Q: Write a C code that finds the numbers of the Fibonacci sequence in a sequence entered by the user.…
A: Answer: a = input('Enter first number') b=input('Enter second number') x = [ X i=1 if (a > b)…
Q: For this question please write a basic python code for each point displaying how the concept is…
A: Note: since question contain multiple sub-parts but we can answer only first 3-sub parts at a time…
Q: Is it possible to bubble sort or selection sort or insertion sort string or char[100] for names…
A: Sorting is one of the most basic and useful functions applied to data. It aims at arranging data in…
Q: I need this Code By C++ Please stick to the code at the bottom of the page Just By C++. The file…
A: Here I have checked the condition for input to be 0,1,2, or any other number. If the input operation…
Q: 13. The reciprocal Fibonacci constant y is defined by the infinite sum: ν- ΣΕ where F, are the…
A: Program:n = [10 50 100];for j = 1:3a = 1;b = 1;reci = 1/a+1/b;for i = 1:n(j) - 2c = a + b;reci =…
Q: Q1) Write a program to add 3 numbers ( 2 bytes each), The 1" one is stored in memory locations…
A: Write a program to add 3 numbers two bytes each.
Q: Fill-in-the-Blank The __________ operator is used to dynamically allocate memory.
A: new int; //allocates an int dynamically new double; // allocates a double dynamically
Q: Write the generated code sequence for the following basic block
A: Generated code sequence: MOV a , R0 SUB b , R0 MOV R0 , t1 MOV a , R1 SUB c , R1 MOV R1, t2 MOV u ,…
Q: 5. Rewrite the following code using a switch statement.
A: Approach Here, we are asked to replace if else-if with a switch statement. We will use the switch…
Q: 2- Write a program in M-File to read 3 x 3 Matrix, then display the diagonal of matrix as shown…
A: code : - % for loops to get the inputs for matrix for i=1:3 for j=1:3 p(i,j)=input(' ');…
Q: Write a for loop with index i that iterates over all consecutive integers from 4 to 10 and prints…
A: for i in range(4,11): print(i)screenshot of output:
Q: Q5 (a) What is the data type of pointer variables? Suppose that we don't know the name of a variable…
A: 1) Pointer datatype Pointer is a variable in that holds the address of another variable. They have…
Q: Can't get the following code to run because of two int mains, but don't know how to consolidate it…
A: EXPLANATION: One can use two different methods to join the main function. If you want to define the…
Q: #include #include #define MAX 4000 int main(void) FILE* bkPtr; char buffer[MAX]; fopen_s(&bkPtr,…
A: Robinson Crusoe is a novel by Daniel Defoe, first published on 25 April 1719. The first edition…
Q: State which of the following are true and which are false. If false, explain why.c) A program must…
A: fclose function The fclose function is a C library function used to close a file stream. Syntax:…
Q: 37 86.56 32 What value (if any) is assigned to x, y, and z after each of the following statements…
A: Please find the answer below :
Q: onsider the following code ar nt ary) = (5, 9, 4, 2, 6, 7, 8, 4 A: What is the starting index B:…
A: A. Indexing always starts with 0. so the starting index is 0.
Q: using c++ and use pointer and char(don't use string): Write a class date (d, m, y), class file…
A: I have provided the code for Date ,File and Directory class as per the given requirement.
Q: - Type the below into Python and see what happens. def reuse_code(): comment = input("Type something…
A: Here first we define function reuse_code(). Which promt user to Type something in then user will…
Q: Q1) Write a program to subtract 2 numbers ( 2 bytes each), The 1" one is stored in memory locations…
A: LHLD 2033 XCHG LHLD 2044 DAD D XCHG LHLD 2066 DAD D SHLD 2055 HLT
Q: Q1) Write a program to add 3 numbers ( 2 bytes each), The 1" one is stored in memory locations…
A: Write a program to add 3 numbers two bytes each.
Q: Write a program that reads data from a data file, the value of which is provided at the end of the…
A: Follow the below algorithm for creating the program with the given description: Include header…
Q: How would I solve this problem in python language Grades a) Write a program that reads in the names…
A: Program Instructions:Use the open() function to read from the file.Save the result o spilt()…
Q: Write a simple C program that can determine whether a machine is little- or big-endian.
A: Solution: Little Endian: The little endian show is a sort of addressing that alludes to the request…
Q: 2. Write a function in Python to count and display the total number of words in a text file.
A: Start Open the file in read mode using open() and rt attribute Read the text using read() Split the…
Q: Complete the following sentence. f more than one function is present in a file, the top function is…
A: Local functions are private methods of a type that are nested in another member.
Q: 3- Write a Matlab function file that asks the user to enter the student's result in first midterm…
A: According to the Bartleby guideline we are suppose to answer only one question at a time. Kindly…
Q: Write C++ statement(s) to allocate space for 10 doubles (using dynamic memory allocation).
A: new is used to allocate space dynamically. syntax: new data-type; statement to allocate space for…
Q: answer asap only code require no output need fasstttt please create a C++ program code that could…
A: C++ used to answer this question
Q: 5.14 For each of the following sets of integers, write a single statement that will print a number…
A: a) Program code: //import required data package import java.util.Random; //main class public…
Q: 1-Suppose x and y are int variables and z is a double variable. Assume the following input da 37…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: 21.7 LAB: Login name (Use python) Write a program that creates a login name for a user, given the…
A: name = input("Input: ") lst = name.split(" ") #lst[0] = first name, lst[1] = last name, lst[2] =…
Q: 2) Write a program in M-File to read 3 x 3 Matrix, then display the diagonal of matrix as shown…
A: Answer: for i=1:9; %for loop to take user inputs a(i)=input(''); %taking…
Q: 13. The reciprocal Fibonacci constant y is defined by the infinite sum: Σ. where F, are the…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: 4.26 The cryptography function crypto() takes as input a string (i.e., the name of a file in the…
A: The cryptography function crypto() takes as input a string.The function should print the file on the…
Q: 15. Let C be the set of all Circles in the world, and S be the set of all Squares in the world. Vx E…
A: In questions with many questions, we must answer first one
need help:
(Address book) Write a program that stores, retrieves, adds, and updates addresses as shown in Figure 17.20. Use a fixed-length string for storing each attribute in the address. Use random access file for reading and writing an address. Assume that the size of name, street, city, and zip is 32, 32, 20, 2, 5 chars, respectively
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- (21) 2. Write a Java application that asks the user to enter a car model or 'done' when finished. If the user enters a car model, ask the user to enter the color of that car model. Store the cars and colors in ArrayLists of type String. When the while loop completes, use a for loop to print out the car and color as shown below: Enter a car or 'done if done: Camry Enter color of car: White Enter a car or 'done' if done: Accord Enter color of car: Blue Enter a car or 'done' if done: done car: Camry, color: White car: Accord, color: BluePlease do this in C++ 9.18 LAB: Movie show time display 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. Hints: Use…Python 9.11 LAB: Course Grade Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. 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 tsv file from the user. Open the tsv file and read the student information. 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 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the students into a text file named…
- Task 1: Signup SystemIn the StringAssignment.c file there are two global arrays of String namely emailArr and passArr.Implement the function signupUser() that takes two String as input, one for user email and another for password. You need to do the following checks:1. Is the email in valid format? 2. Does the password contain at least 8 characters?3. Does the password have both uppercase and lowercase letters?4. Does the password contain digits?5. Does the password contain any of the special characters ($ # * @)?If any of the checks returns false, the signup will not be successful. In that case you need to show proper error message, and return FAIL_VAL. Otherwise, the signup will be successful if all of these checks return true. In that case show success message, return the array index, and store the user email and thepassword into emailArr and passAarr respectively.N.B. You need to discard duplicate signup.Task 2: Login SystemImplement the function loginUser() that takes two String…Task 1: Signup SystemIn the StringAssignment.c file there are two global arrays of String namely emailArr and passArr.Implement the function signupUser() that takes two String as input, one for user email and another for password. You need to do the following checks:1. Is the email in valid format? 2. Does the password contain at least 8 characters?3. Does the password have both uppercase and lowercase letters?4. Does the password contain digits?5. Does the password contain any of the special characters ($ # * @)?If any of the checks returns false, the signup will not be successful. In that case you need to show proper error message, and return FAIL_VAL. Otherwise, the signup will be successful if all of these checks return true. In that case show success message, return the array index, and store the user email and thepassword into emailArr and passAarr respectively.N.B. You need to discard duplicate signup.Task 2: Login SystemImplement the function loginUser() that takes two String…# dates and times with lubridateinstall.packages("nycflights13") library(tidyverse)library(lubridate)library(nycflights13) Qustion: Create a function called date_quarter that accepts any vector of dates as its input and then returns the corresponding quarter for each date Examples: “2019-01-01” should return “Q1” “2011-05-23” should return “Q2” “1978-09-30” should return “Q3” Etc. Use the flight's data set from the nycflights13 package to test your function by creating a new column called quarter using mutate()
- Using C++ complete the following program 10.18: Phone Number ListWrite a program that has an array of at least 50 string objects that hold people’s names and phone numbers. The program then reads lines of text from a file named phonebook into the array. The program should ask the user to enter a name or partial name to search for in the array. All entries in the array that match the string entered should be displayed-- thus there may be more than one entry displayed. Prompts And Output Labels. The program prints the message "Enter a name or partial name to search for: " and then after the user enters a some input and hits return, the program skips a line, and prints the heading: "Here are the results of the search:", followed by each matched string in the array on a line by itself. Input Validation. None.15: points.cpp) Write a program that reads 10 pairs of Cartesian coordinates from a file called "points.txt" and sorts them by increasing x-values, decreasing y-values, and increasing distance from the origin. Use only one sorting routine. Use an enumerated data type to keep track of the field on which the list is being sorted. The number of pairs should be in a global constant.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.
- 1.0) head Function Define and implement this function in data_utils.py. Purpose: Produce a new column-based (e.g. dict[str, list[str]1) table with only the first N (a parameter) rows of data for each column. Why: Visualizing a table with hundreds, thousands, or millions of rows in it is overwhelming. You frequently want to just see the first few rows of a table to get a sense you are on the correct path. Function name: head Parameters: 1. dict[str, list[str]]-a column-based table of data that will not be mutated 2. int - The number of "rows" to include in the resulting list • Return type: dict[str, list[str]] Implementation strategy: 1. Establish an empty dictionary that will serve as the returned dictionary this function is building up. 2. Loop through each of the columns in the first row of the table given as a parameter. 1. Inside of the loop, establish an empty list to store each of the first N values in the column. 2. Loop through the first N items of the table's column, 1.…C++ arrays task The scientist monitors the movement of a particle suspended on the surface of the water and records its coordinates every n seconds. make a program that calculates the minimum, average, and maximum velocities of the particle and the distance traveled by the particle. The first line of the original data file contains the number of particle coordinates m (1 <m <100) and the coordinate capture interval in n (n> 0) seconds. The following lines show the particle coordinates xi and yi (1 <i <m) in millimeters (xi and yi are real numbers). Record the minimum, average, and maximum velocities of the particle and the distance traveled by the particle in the result file.C++ ARRAYS (The result should be as the image provided!) 3. Population In the Lithuanian register, the personal identification code data of the population is stored in the format SYYMMDDXXXX. Here: S- Gender: 3 (male, 1900-1999), 4 (female, 1900-1999), 5 (male, 2000-), 6 2000-), YY is the last two digits of the year of birth (00, 01, 02, 03, MM - month of birth number (01, 02, 03, ... 11, 12), DD - number of the date of birth (01.02, 03, ... 30, 31), XXXX - registration number (0001 ... 9999). Make a program that will find the dates of birth of the eldest Lithuanian man and woman and display them on the screen. The first line of the source data file contains the personal codes n (1 <n < 3000). Next, each line contains one code.