employeeAbsences.bxt # × daysOut.cpp EMPLOYEE ABSENCE REPORT employee id 1234 days absent 3 22 667 4 11 9876 The 5 employees were absent a total of 20 days. The average number of days absent is 4.0 days. Programmer: insert your name here
Q: #BABY DAYCARE PROGRAM def getTallest (name, height): n = len (name) large = height[0] for i in range…
A: According to the given instruction I have create a list age[] to store the age of the babies. And…
Q: Provided the following structure: typedef struct coin { char name[30]; int id; double price; }…
A: Answer is Option 1) AltCoin acoin; strcpy(acoin.name, "JamesCoin"); option 2) is wrong…
Q: Please Explain this code Step by Step (How Code Works). #include #include #include char…
A: Program is given and need to explain how it is work.
Q: Teacher has prepared the result of a class containing n number of students. He wants to give the…
A: #include <iostream> using namespace std; void three_toppers(float marks[], int n){ float…
Q: - CREATE - SHIPPING : int = 1 - DELIVERED : int = 2 - PAID : int = 3 1 Customer - String YAddress :…
A: Purchase product is a relation based attribute between customer and order. Make payment is a…
Q: def finalscore (assignment): gradesum-0 finalgrade=0 for index in range (assignment) : grade=int…
A: I have simplified your code a bit and have omitted out few unnecessary lines/variables.. Check the…
Q: This is what it should look like with correct input. Invoice Total Calculator Customer Type: Regular…
A: ans is given below
Q: #include #include void main( ){ char string1 [100]; char string2 [25]="Mohammed Abdullah,"; char…
A: Answer: Second Option is correct. Because first two is strcat and last one is strcpy so whatever is…
Q: #include #include struct batsman { char name[20]: p: char* foo(struct batsman *t) strepy(t->name,…
A: Introduction : Given , Code Segment we have to explain its output.
Q: What do you know about minutes of meeting? Also write down a sample of minutes of meeting which you…
A: Given:- What do you know about minutes of meeting? Also write down a sample of minutes of meeting…
Q: Bill Discount Write a Python program that calculate the bill discount based on the customer type…
A: Python Program for above : #get the bill Bill = float(input("Enter your bill: ")) customer =…
Q: Fix the errors in the procedure below. def BMIImperial(height, weight, bmiList, Category): i=0…
A: Given program contain indentation errors. This can be eliminated by correctly indent the line of…
Q: create a prog that will compute the final grade for a certain student and will display the final…
A: In this program, the C++ programming language is used which is object-oriented programming and also…
Q: Please rewrite the code given below and written in C, in Python. #include #include int…
A:
Q: an azuenuI DUE UIEIãord after reading from a file “emp.txt". struct perSalary int month; /* number 1…
A: C code: /* C program for show employee data represented as structures */ /* include necessary…
Q: #include #include struct batsman char name[20]; }p: char* foo(struct batsman *t) strcpy(t->name,…
A: struct batsman{ char name[20];}p; is a structure which stores string and structure variable…
Q: You develop a Python application for your company. A list named employees contains 200 employee…
A: lists can be accessed by employees[:_] structure which would display all the values between the…
Q: Rewrite the following code segment so that it does not cause an error. decimal pricePerFoot = 2.99m;…
A: Given code: //Declare and initialize variables Decimal pricePerFoot = 2.99m; double boardLenth…
Q: #include #include struct batsman char name[20]; p; char* foo(struct batsman *t) strepy(t->name,…
A: Here first of all we have a structure named batsman with one attribute as a name. Now in the main…
Q: What is the outpt Tör the int index = 0; int result = 1; while ( true ) { %3D ++index; if ( index %…
A: The answer is as follows.
Q: Use Python Programming - restaurant reservation program. The application offers different…
A: Given: Use Python Programming - restaurant reservation program. The application offers different…
Q: Given the following... int j; int sum; double sale[10][7]; Which of the following correctly finds…
A: b. sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[4][j]; will find the sum of…
Q: Write code to get information of 5 students (Exam id , average) then check the average them if it is…
A: As no programming language is mentioned, it is solved using basic C++
Q: case 5: System.out.print("Enter the student's ID code: "); String studentid = readInput.next();…
A: There Should be Closing Curly Braces for Closing the loop.
Q: With the given statement, With the given statement, #include Finclude struct item struct product…
A: The program declares a struct named product containing two variables named id and name. Variable p…
Q: • The Emerging Manufacturing Company has decided to use its new computer for payroll. • You have…
A: Java Program: import java.util.*; import java.io.*; class Employee { private String id;…
Q: void printTicket ( Booking Bookings[], int ID_num, int n ) { int id = -1; string destination ; if (…
A: The answer is given below.
Q: 4. What will be stored in person at the end of this code? var firstName; var lastName; var age; var…
A: 1) Code snippet in question is JavaScript code 2) It declare 4 variables firstName, lastName,age and…
Q: Declaration of variables shares - 2000 shareBuy - 40 shareSell - 42.75 brokerRate - 0.03 SProcessing…
A: Introduction of Flow Chart: A flow chart is a pictorial representation of any task or program. It…
Q: def COURSE H ine COURSE_H s Course { rate: tring code; nt section; nt maxStudents; nt numStudents;…
A: I have completed the code below:
Q: I have a computer since project c++ and we choose an airport system so can u explain this part of…
A: Solution: C++ Program Explanation: /** * This printTicket() function accept array of class…
Q: Given the following struct definitions, what is the correct way to print the month a movie was…
A: Nested structure is structure within structure. One structure can be declared inside other structure…
Q: Annotate following code. def QualityPointCalculator(qualPnts, crdts): if crdts > 0:…
A: EXPLANATION: - The empty lists for quality_points, course_names, grades, and credits are defined.…
Q: #include #include typedef struct PersonStruct { char firstName[15]; char middleName [15]; char…
A: Please upvote. I am providing you the correct answer below.
Q: secendterm = thirdTerm Next Trace the values of the following variables throughout the loop:…
A: Here the loop will run from i=3 to number ie 7 and it will increment in steps of 1.
Q: Here is my code from part 1. The below directions are an extension of it: #include using…
A: given: #include <iostream>using namespace std;#include "ItemToPurchase.h" int main(){string…
Q: -The second variable should show the percentage of 'trans_fat in 67 total fat.* 68 -*** (r} 69…
A: Note: Answer As per problem mention in problem first of all you are calculating percentage , so…
Q: Use Python Programming - restaurant reservation program. The application offers different…
A: if(choice == "a"): if (len(reservation) == 0): print("There are no reservations!!")…
Q: Use the declaration below to answer the next set of questions. struct DateTag{ int nMonth; int nDay;…
A: Here in the given code snippet, we have different structs which are also written inside each other…
Q: As part of the discussion forum for this unit, you will be solving a programming problem from the…
A: Modulus operator(%) is used to remainder of division.
Q: int main() { CDAC count account; cout > cout > _?__.term; 2_.interestRate;
A: Note: The answers to the first three fill-in blanks of the main function are given. Please repost…
Q: Display the output similar to the output given below: Your StudentID Student ID Student Name Your…
A: #Code:- I have used C++ programming language because you have not mentioned in the question.…
Q: D START Read itemName Read pricePerUnit Read Quantity totalCost = Quantity* pricePerUnit Read…
A: #include <stdio.h> int main(){ char itemname[100]; scanf("%[^\n]s", itemname); float…
Q: A car database of the sale website contains 10 cars with the car brands (1= Ferrari, 2 = Lamborghini…
A: Hello Student. Greetings from my side. Hope you are doing great. I will try my best to answer your…
Q: class Student { public: 10101010 101012 0101100 Student() {}; Student(int ID, string name, string…
A: Stack is a kind of container adapter with LIFO (Last In First Out) operation, where a new element is…
Q: struct namerec{ char last[15]; char first[15]; char middle[15]; struct payrecord{ int id; struct…
A: Step 1 A struct is a user defined data type that contains variables of multiple data types. It is…
Q: Given the following declaration: int j; int sum = 0; double expenses[15] [8]; Which of the following…
A: Answer: NONE OF THE OPTION WILL correctly finds the sum of the sixth column of expenses. the correct…
Q: ticket_price 이6 Complete the following function according to its docstring description. 1 bef…
A: I have given the completed code below.
Q: Analyze the following code and fill in the output. # Employee List name - ["Joe","Janice", "Ahmed",…
A: The output is : Joe worked 40 at 17.55 making 702 Janice worked 42 at 12.35 making 1683 Ahmed worked…
c++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- You must create a function that takes a string as its sole input parameter. A string is the only return from the function. Using the input string as a basis, the function should generate a filename. This will be accomplished by capitalizing the initial letter and replacing each space in the string with an underscore, i.e. (" _ "). The function should return the newly formed filename. this code below generates filename elif command == "5": #<you will write this function here> filename = make_filename5(place) print(filename) an example would be: 'Dubai, Iraq, 2021' -------> make_filename5 ------->'Dubai,_iraq,_2021' 'spain is beautiful' ------> make_filename5 ------->'Spain_is_beautiful' 'America' ------> make_filename5 -------> 'America' elif command == "5": <you will write this function here > filename = make_filename1(place) print(filename)Create a global variable of type ofstream for the output file. Use this variable to open the file employeeAbsences.txt in your program to write data to it. A global variable is defined above the main function and its scope is within the entire program. A function called NumOfEmployees. This function asks the user for the number of employees in the company. This value should be returned as an int. The function accepts no arguments (No parameter/input).A second function called TotDaysAbsent that accepts an arguments of type int for the number of employees in the company and returns the total of missed days as an int. This function should do the following: Asks the user to enter the following information for each employee:The employee number (ID) (Assume the employee number is 4 digits or fewer, but don't validate it).The number of days that employee missed during the past year.Writes each employee number (ID) and the number of days missed to the output file (employeeAbsences.txt). (…Write a function called countWord(). It takes 2 parameters: The name of a text file(e.g. gettysburg.txt) and a word to be searched within that file. Your code should returnthe number of times the given word appears in the file.>>> countWord('gettysburg.txt', 'people')3
- Two of the menu options (#2 and #3) are unfinished, and you need to complete the code necessary to write to and read from a binary file. You will need to read through the code to find the functions that are called by these options, and then supply the missing code. How do I get menu 2 and 3 to display properly?the .cpp and .h have the information:.cpp file: // Corporate Sales Data Outputusing namespace std; #include <iostream>#include <fstream>#include <stdlib.h>#include "HeaderClassActivity1.h" int main() { Sales qtrSales[NUM_QTRS]; while (true) { cout << "Select an option: " << endl; cout << "1. Input data" << endl; cout << "2. Write data to file" << endl; cout << "3. Read data from file" << endl; cout << "4. Display sales" << endl; cout << "99. End program" << endl; int menuItem; cin >> menuItem; if (menuItem == 1)…Two of the menu options (#2 and #3) are unfinished, and you need to complete the code necessary to write to and read from a binary file. You will need to read through the code to find the functions that are called by these options, and then supply the missing code. Please help me get menu 2 and 3 to display properly.the .cpp and .h have the information:.cpp file: // Corporate Sales Data Outputusing namespace std; #include <iostream>#include <fstream>#include <stdlib.h>#include "HeaderClassActivity1.h" int main() { Sales qtrSales[NUM_QTRS]; while (true) { cout << "Select an option: " << endl; cout << "1. Input data" << endl; cout << "2. Write data to file" << endl; cout << "3. Read data from file" << endl; cout << "4. Display sales" << endl; cout << "99. End program" << endl; int menuItem; cin >> menuItem; if (menuItem ==…in this function is f a variable? in what other way can we write this function? why does mode not work in this function? def process_lines(filename, mode): # Actually this is function is used to read the file line by line with open(filename, 'r') as f: # file opened msg = f.read() # read the message return msg # return message def write_lines(lines): # function to write some into message with open('results.txt', 'w') as f: # open the text file f.writelines(lines) # write some line print("Output written to results.txt") # print the output what does os.path do?def check_file_exists(filename): # check weather this file is exist or not to avoid exception from os.path import exists # import library of exist file_exists = exists(filename) # if file exist return file_exists
- 1-) Write a code to do following operationsa-print the contents of filewrite a function to print the contents of a given file on screen. Your function prototypeshould be in given format.void PrintFileContent(FILE* fptr)b-copy contents of one file to another filewrite a function to copy contents of one file to another file. Convert all characters intouppercase while copying the content. You are allowed to use toupper() function in ctypelibrary. Your function prototype should be in given format.void copy_file(FILE* fptr1,FILE* fptr2)c- count the Number of Characters in a Filewrite a function to count the Number of Characters in a File. Your function prototypeshould be in given format.int findNumberofChar(FILE* fptr)Please design your main.c file as follow1- Open a text file to read in your directory.2- Create an empty text file for writing and reading in same directory.3- Check if both files are opened.4- Print the contents of first file by calling PrintFileContent function.5- Call…*****PLEASE WRITE IN C# (C SHARP)***** Write a program that will create file with at least 10 lines. Each line of your file should have information delimited by some delimiter (I.e., commas, spaces, slashes, symbols, etc.). After your file has been created with the proper amount of data, you should read your file line by line and display without the delimiters in the same program after closing your writer. Additionally, the information stored into your file should be data that is gathered from a separate class. Your program should save your file in a specific directory. To promote flexibility, your program should check to see if the chosen directory exists prior creating it, and if it does not exist, your program should create it for you. Additionally, you should allow the user to enter the names of the directory and file instead of hard-coding it into your program.One of the parameters of the print function is the file parameter. Its task is print () where to write the character string and / or numbers, that is, the parameters given to the function to indicate. The default value of this parameter is sys.stdout. File parameter using properties and using the command "file = open (" test.txt "," w ")" Create a text file and write the code that finds the words in the second in the first of the text files you created.
- Your program should follow the steps below: 1. Prompt the user to enter the input PPM file name, the output PPM file name, and one of the following commands to determine what modification should be applied to the input PPM image so that the modified image is stored in the output PPM file: A. "negate" B. "high contrast" C. "gray scale" D. "remove <color>" where <color> is "red", "green", or "blue" 2. Apply the image modification based on the user command. You must define the functions mentioned below to perform the image modification. Note that the original image file should not be changed; the modified image must be stored in the output PPM image file name. Also note that the output file should have the same header lines as the input file. a. negate_image(): accepts the input image file object and the output image file object as arguments. For each pixel element in the input file, it takes the value, subtracts 255 from it and takes the absolute value of the result. This…Write a function named file_stats that takes one string parameter (in_file) that is the name of an existing text file. The function file_stats should calculate three statistics about in_file: the number of lines it contains, the number of words and the number of characters, and print the three statistics on separate lines. For example, the following would be the correct input and output:>>> file_stats('created_equal.txt')lines 2words 13characters 72Note: The number of characters may vary slightly between operating systems. Similarly, the number of lines may vary by 1 line, depending on the method used to calculate it.Files and Input #include <iostream>#include <fstream>#include <string>#include <iomanip>using namespace std; int main() { //Declare variables string employee; double RateOfPay, salary; int hours; cout << fixed << setprecision(2); ifstream in("WorkLoad.txt"); getline(in, employee); in >> RateOfPay >> hours; in.close(); salary = hours * RateOfPay; if (hours > 38) salary = (38 * RateOfPay) + ((hours - 38) * RateOfPay * 1.5); else salary = hours * RateOfPay; cout << employee << " worked " << hours << " hours at a rate of pay of " << RateOfPay << ". Due to the number of hours worked the employee did "; (hours > 38) ? cout << "" : cout << "not "; cout << "qualify for time and a half pay. The weekly salary for this employee is " << salary << endl; // open output file Salary.txt for writing…