I Am Looking To Split My Single-function C Business Calculator Program Into Numerous Functions.
I am looking to split my single-function C business calculator program into numerous functions. For example, separating the recurring parts of the code, such as when the program asks the user the costs of meals, fees, etc. 1. My goal is to not have any functions exceeding 20 lines. My code: #include using namespace std; int main(int argc, const char * argv[]) { //Command line arguments. ‘argc’ is argument count; it stores how many arguments that will be passed onto the main function of the program. ‘argv’ is argument vector’ and it stores the array information. These are in this program as they are what pass the main values into the main function of the program. int conti=0; //This line is for later on in the program when the user is asked whether or not they wish to use the calculator again, or quit. ‘continue’ do{ std::cout <>daysOfTrip; int parkingfee[daysOfTrip],hotelFee[daysOfTrip-1]; //Minus one as hotel stays are one day shorter than a day trip. example: 3 day trip is 2 hotel nights. int breaks[daysOfTrip],lunch[daysOfTrip],dinner[daysOfTrip]; //All mealtimes coincide with the days within the trip. for (int i=0; i<daysOfTrip; i ) { breaks[i]=0;lunch[i]=0;dinner[i]=0; } int employeePaid = 0; cout<<endl<>deptTime; cout<<endl<>arrivalTime; cout<<endl<>airfare; totalcost =airfare; cout<>confOrSemRegFee; totalcost =confOrSemRegFee; //total cost equals ‘total cost’ plus ‘conference or seminar fee’. cout<<endl; int rentalOrTaxi=0; do{ cout<>rentalOrTaxi; if(!(rentalOrTaxi==1 || rentalOrTaxi==2)){cout<<endl<<"Invalid input. Please try again."<<endl;} }while(!(rentalOrTaxi==1 || rentalOrTaxi==2)); int typeOfCar=0; int rentalFee=0; float gasFee = 0; if(rentalOrTaxi==1){ do{ cout<<endl<<"1. Sedan"<<endl<<"2. SUV"<<endl<<"3. Van"<<endl<<"4. Convertible"<>typeOfCar; if(!(typeOfCar==1 || typeOfCar==2 || typeOfCar==3 || typeOfCar==4)) cout<<"Invalid input. Please try again."; }while(!(typeOfCar==1 || typeOfCar==2 || typeOfCar==3 || typeOfCar==4)); } int milesDriven=0,totalTaxiCharges; if(rentalOrTaxi==1){ cout<<"Enter the total miles Driven:"<>milesDriven; if(typeOfCar==1){ rentalFee=20; gasFee=0.24; }else if(typeOfCar==2){ rentalFee=25; gasFee = 0.27; }else if (typeOfCar==3){ rentalFee=30; gasFee = 0.32; }else if(typeOfCar==4){ rentalFee=50; gasFee = 0.45; } totalcost = rentalFee*daysOfTrip gasFee*milesDriven; } else{ cout<>totalTaxiCharges; totalcost =totalTaxiCharges; } if(rentalOrTaxi==1) for (int i=0; i<daysOfTrip; i ) { cout<<"Enter parking fee for day "<<i<>parkingfee[i]; if(parkingfee[i]>10){//company cannot pay more than $10. employeePaid = parkingfee[i]-10; parkingfee[i]=10; } } for (int i=0; i<daysOfTrip-1; i ) { cout<<"Enter hotel fee for the night "<<i<>hotelFee[i]; if(hotelFee[i]>90){//maximum 90$ reimbursement employeePaid = hotelFee[i]-90; hotelFee[i]=90; } } int noOfBreakfasts=daysOfTrip, noOfLunches=daysOfTrip,noOfDinners=daysOfTrip; for (int i=0; i18){ cout<12){ cout<>dinner[i]; noOfBreakfasts–; //Post-decrement ‘–‘ for the program to run through the correct number of days of the user’s trip. noOfLunches–; }else if(deptTime>7){ cout<>lunch[i]; cout<>dinner[i]; noOfBreakfasts–; } }else if(i==daysOfTrip-1){ if(arrivalTime<8){ cout<<"Nothing is provided by the company on last day."; noOfBreakfasts–;//he comes before 8 so breakfast is not provided, similarly below. The next chunk of lines is pretty self-explanatory. noOfLunches–; noOfDinners–; }else if(arrivalTime<13){ cout<>breaks[i]; noOfLunches–; noOfDinners–; }else if(arrivalTime<19){ cout<>breaks[i]; cout<>lunch[i]; noOfDinners–; }else{ cout<>breaks[i]; cout<>lunch[i]; cout<>dinner[i]; } }else{ cout<<"All three meals are provided for day "<<i 1<<endl<>breaks[i]; cout<>lunch[i]; cout<>dinner[i]; } } for (int i=0; i9){ //the numbers represent the cost that the company will reimburse up to. For example, the company will reimburse breakfast up to $9. employeePaid =breaks[i]-9; breaks[i]=9; } if(lunch[i]>12){ employeePaid =lunch[i]-12; lunch[i]=12; } if(dinner[i]>16){ employeePaid =dinner[i]-16; dinner[i]=16; } } for (int i=0; i<daysOfTrip; i ) {//adding reimbursement; totalcost =breaks[i] lunch[i] dinner[i] hotelFee[i] parkingfee[i]; } cout<<endl<<"Total expenses reimbursed by company are "<<totalcost<<endl; cout<<endl<<"total Employee expenses are "<<employeePaid<<endl; cout<>conti; }while(conti!=0); return 0; }
A Training School That Provides Training Classes For Different Units Of An Organisation Wishes
A training school that provides training classes for different units of an organisation wishes to automate enrolment for her classes . The school should be able to set up different classes, set date and period for the classes and set maximum number of participants that can enroll for the classes . Staff of the organization should be able to enroll for any of the training classes. To enroll a user must sign in to the portal,view all available classes and then register for classes of choice. The system administrator should be able to create users, create training classes and create venues. Deletion and updating of classes should be done by the admin. All users should be able to view all training classes created. If a user wishes to register for a class, he/she proceeds to login page before given such access. Design and develop a web application using HTML,CSS, Javascript and PHP for the training school based on the requirement above. It is a school assignment and this is how the question was given to us. Thanks
Assignment: This Problem Uses Fuel Economy Data In Miles Per Gallon (mpg) Taken From
Assignment: This problem uses fuel economy data in miles per gallon (mpg) taken from the following US Department of Energy website: http://www.fueleconomy.gov/feg/download.shtml. The data files you have been provided with have been adapted from the CSV file on the website, and contain vehicle testing data for all models tested between 1984 and 2014 (last updated Sept 30, 2014). The first data file, carModelData_city, contains all the test results for city mpg and the second, carModelData_hwy, contains all the test results for highway mpg. Each file contains the same number of values, as the values in the same position in each list refer to the same vehicle. You will likely want to use the float() function to cast the string values to floats. a. Write a function readData(filename) that will read in all the data from a text file that consists of float data formatted such that each value is on a new line. b. Write a function averageMPG(dataList) that calculates the average mpg for all vehicles tested given a list of the mpg values. c. Write a function countGasGuzzlers(list1, list2) that calculates the number of gas guzzlers among the vehicle models tested – for this program, define a “gas guzzler” as a car that gets EITHER less than 22 mpg city OR less than 27 mpg highway. d. Write a function output() to print the following output (you will determine what parameters this function needs to have passed in to it): i. The total number of vehicles tested ii. The average for the city mpg for all the vehicles tested iii. The average for the highway mpg for all the vehicles tested iv. The number of gas guzzlers among the vehicle models tested e. Write a program fuelEconomy.py that contains a main() function that calls all the functions you made in parts a-d. Details: As you have done on the earlier home-works, add comments to your Python functions describing the required inputs (if any) and the expected outputs. In addition, add comments as appropriate within the body of your program (e.g. to explain what a particular block of code is meant to accomplish).
Write A Program That Inputs A Line Of Text And Uses A Stack
Write a program that inputs a line of text and uses a stack object to print the line reversed. Hint: your program could utilize list.h, listnode.h, and stack.h class template definitions.
Use Matlab To Create A Function That Can Determine Range (landing Distance) Of An
Use Matlab to create a function that can determine range (landing distance) of an arrow, given initial conditions are provided as inputs. Assume the ground is at y = 0. First two rows are given and can not be changed: 1. function Range = partAQ3(y0,v0,theta) 2. g = 9.81;
A Company Wants You To Create A Program To Manage Records And Do Analysis
A company wants you to create a program to manage records and do analysis regarding projects. The company stores all information in a file as follows: The PROJECT file contains project characteristics such as the project name and project code. The EMPLOYEE file contains the employee names, phone number, address, etc. The JOB file contains the billing charge per hour for each of the job types – a biological engineer, a computer technician, and electrical engineer would generate different billing charges per hour. The CHARGE file would be used to keep track of the number of hours by job type that will be billed for each employee who worked on the project. Requirements 1. This problem must be solved using structures and arrays. Create the struct for each file. In the driver program, read the files into the respective arrays. The analysis should happen through these arrays. 2. Your program should do the following: Read the data file and store details in arrays. Create a menu for the user that can do the following: o Exit program o Display all projects handled by the company o Display Employee ID, Employee Name, Job Description and Total amount earned by each employee. Amount can be calculated using CHG_HOURS and JOB_CHARGE PROJ_CODE JOB_CODE EMP_ID CHG_HOURS(Charge.txt) 1 CT 105 16.20 1 CT 110 14.30 1 EE 101 13.30 2 BE 108 17.50 2 EE 101 19.80 3 CT 105 23.40 3 CT 110 11.60 Employee.txt: EMP_ID EMP_LNAME EMP_FNAME EMP_INITIAL EMP_AREA_CODE EMP_PHONE 101 Newson John D 653 234-3245 105 Schwann David F 653 234-1123 108 Sattlemeier June H 905 554-7812 110 Ramoras Anne R 615 233-5568 Job.txt: JOB_CODE JOB_DESCRIPTION JOB_CHARGE BE BiologicalEngineer 55.00 CT ComputerTechnician 62.00 EE ElectricalEngineer 65.00 Project.txt: PROJ_CODE PROJ_NAME 1 Hurricane 2 Coast 3 Satellite IN C PROGRAMMING LANGUAGE The output should allow users to enter choices upon which choices from menu bar must be displayed eg : ………………….(1)…………..Exit the program…………………………………………. ………………….(2)………….Display project txt file …………………………………. ………………….(3)………….Display change.txt file ………………………………… ………………….(4) …………calculate total of all ……………………………………… ………………….(5)…….display all files with respective totals …………………… **** Need coding in Dev C C Language
Soleve The Question Number 15 And 16 As Soon As Possible Using C Developer
soleve the question number 15 and 16 as soon as possible using c developer
Consider The Following Scenario: Your School Intends To Develop A Student Management System. The
Consider the following scenario: Your school intends to develop a student management system. The system will need to hold all details of registered students, including personal information, courses taken, and examination grades. A description of the core activities in the software development process. An explanation of the distinction between systems analysis and systems design and a description of the activities involved in each. An explanation of the benefits of information systems. An explanation of what the information system’s requirements are. An explanation of why the information system’s requirements are difficult to determine correctly. An explanation of why the testing stage of systems development is so important. An explanation of the difference between the three stages of testing for an information system. A description the role of programming, conversion, production, and maintenance in systems development. An evaluation of which of the three (programming conversion, production, and maintenance) is most important to project success and why. An explanation of which of the three (conversion, production and maintenance) is most difficult to do correctly and why. An analysis of the benefits and limitations of each of the following methods of building information systems: traditional waterfall method, prototyping, and component-based development. A recommendation for which method the school should use for developing a student management system and justification of your choice.
Please Build A Network Diagram With The Following Requirements: The Network Should Have 3
Please build a network diagram with the following requirements: The network should have 3 subnets within a single VPC: 1 public-facing (web servers), and 2 private-facing subnets (Databases and SecDevOps pipeline). Say which Security Groups, Availability Zones, and Access Lists you would put in place to ensure external users can view the website on the standard HTTPS port but cannot access any other ports on the web server. Also, how would you configure the Access Lists and Security Groups such that the web server can speak to the database, but cannot access any other unnecessary internal resources? The web “server”, which will reside in your public subnet should have a public IP address and should scale (elastically) to meet any amount of user demand. AWS provides multiple services that accomplishes exactly this. Please tell us what that feature is and exactly how you would configure it. Also, we use the term “server” loosely. You can use an EC2 instances if you’d like, but there are some very useful alternatives you might want to investigate such as ECS or Lambda. Example of what it should look like:
Please Design A DevSecOps Pipeline With The Following Requirements: We’ve Talked A Lot About
Please design a DevSecOps pipeline with the following requirements: We’ve talked a lot about DevSecOps pipelines and the workflows they implement. Suppose the application we’re building here is being developed within AWS and the source code is being stored in Code Commit. Please design a workflow using service offerings that, upon a developer committing code to the repo, kicks off a job that does the following: performs static code analysis (using the SAST of your choice), analyzes the software for software composition analysis (SCA), deploys the application code to a server/container and performs a dynamic analysis (using the DAST of your choice), if all checks pass the pipeline deploys the code to the actual production web server instance(s), and reports the results of the testing and deployment to the development team. Depending on which SAST/DAST tools you select, describe where you would host them (if necessary) and tell us why it could be desirable to run both static and dynamic analysis of your web application. NOTE: the SAST and DAST tools should not be pre-existing AWS service.
How Private Cloud Can Be Converted To Public Cloud In Cloud Computing
How private cloud can be converted to public cloud in cloud computing
Write Down The Pseudo-code For Online Gradient Descent (OGD) And Answer The Following Questions.
Write down the pseudo-code for Online Gradient Descent (OGD) and answer the following questions.
Given Data {(xi , Yi) ∈ R D × {±1} : I ∈ [1,
Given data {(xi , yi) ∈ R d × {±1} : i ∈ [1, n]}, logistic regression is another popular classification method in Machine Learning, which amounts to the following minimization problem: min w∈Rd n f(w) := 1 n Xn i=1 log(1 e −yihw,xii ) λ 2 kwk 2 o , where λ > 0 is a regularization parameter. Work out the gradient function ∇f(w) and the Hessian function ∇2f(w). Show that its gradient function ∇f(w) is Lipschitz continuous with constant L ≤ 1 n Pn i=1 kxik 2 λ, i.e. k∇f(w) − ∇f(w ′ )k ≤ 1 n Xn i=1 kxik 2 λ kw − w ′ k, ∀ w, w ′ ∈ R d
Table Column Styles Go To The Column Styles Section. Create A Style Rule For
Table Column Styles Go to the Column Styles section. Create a style rule for col elements with the ID firstCol that sets the column width to 24%. Create a style rule for col elements belonging to the dataCols class that sets the column width to 19%. Table Header Styles Go to the Table Header Styles section. Create a style rule for the table header row group including every row within that row group that sets the row height to 60 pixels. For the first th element in the first row of the table header row group, create a style rule that sets its font size to 2em. (Hint: Use the first-of-type pseudo-class to select the first table row and first heading cell.) For th elements in the first row of the table header row group that are not the first heading cell, create a style rule that sets the background color to transparent and the font color to black. (Hint: use the not selector with the first-of-type pseudo-class to select headings that are not first in the table row.) I saw the solution, but when I enter that in it still says it’s not correct.
What Tools Are Used For Monitoring And Evaluating IT KPIs. And How Does This
What tools are used for monitoring and evaluating IT KPIs. and how does this tools effectively meets assurance practices. . Discuss how KPIs can be tied to strategic vision and project planning
This Is For Python. Given An Array A Of Non-negative Integers, Return An Array
This is for python. Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. Example 1: Input: [3,1,2,4] Output: [2,4,3,1] This is the code there is to start: def sortArrayByParity(A): A = [3,1,2,4] print(sortArrayByParity(A)) How do I iterate over the numbers to test if they are even or odd?
Alright Experts I Need You Help. I Need To Create A Webpage For A
Alright experts I need you help. I Need to create a webpage for a Pizza website. It will be titled WWP short for world wide pizza. The tag line of the site will be Where Taste Meets The Myth. I do not have a major requirement on pages, but IT will have a main Page and 2 others. The colors will be SaddleBrown, and Tan. May change it later. I can add in the information later as I do this, but I am struggling to even get the coding right. It can be created on notepad but later transferred to notepad . Is there anyone out there than give me a start to help me out? I do not have a title page for suggestions. The layout should be like this, Title World Wide Pizza, Under Neath Centered Where Taste Meets The Myth. Just need help with all of the coding to get the layout. I just cant even get to that point with the coding. The layout will need Page 2-Cheese Pizza a link to learn and read about the history of it and stuff. Page 3-BBQ chicken Pizza page 3. Just a basic website to help me get starting on the coding. I can add all of that later when i upload all of it to notepad . I hope this helps. Made a correction with the colors. SaddleBrown and Tan, i think black will look bad with that color. Thank you for responding to help me
This Is For Python. A Self-dividing Number Is A Number That Is Divisible By
This is for Python. A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-dividing number is not allowed to contain the digit zero. Given a lower and upper number bound, output a list of every possible self dividing number, including the bounds if possible. Example 1: Input: left = 1, right = 22 Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22] So I guess the question is how do only list the self dividing numbers within the bounds? Below is the code that I start with: def selfDividingNumbers(left, right): left = 1 right = 22 print(selfDividingNumbers(left, right))
Suppose That A MIPS Computer System Has A Data Memory That Contains 4 Memory
Suppose that a MIPS computer system has a data memory that contains 4 memory modules each of which has a width of 32 bits and a depth of 134217728. Show an instruction sequence containing only MIPS true-op instructions that reads an IEEE 754 single-precision floating point number from memory and places the floating-point value into register $f8 without causing any kind of exception. The floating-point value resides at memory address 161061273410 (decimal 1610612734).
“Annulling” An Instruction Is Defined As Preventing The Instruction From Having Any Effect Without
“Annulling” an instruction is defined as preventing the instruction from having any effect without having to flush the instruction from the pipeline. Which of the nine control bits generated by the control unit for the MIPS pipeline should be de-asserted to have the effect of annulling the instruction in the branch delay slot?. Use the minimum number of control bits.
Hello Please Answer This Using Javascript What Do I Mean By Parse An Email?
Hello Please answer this using javascript What do I mean by parse an email? Go to GOOGLE email, open an incoming email, and do View Original. You should see a text file of a raw email. The goal here is to parse that and extract relevant fields. Your goals: Take in an email and parse it into relevant fields. Figure out what those relevant fields are. Create a good foundation. Try to write extensible/maintainable code. When you’re done, list out next steps you’d take in your implementation. Eg, ‘I’d focus on handling different MIME types in the body’, etc. Don’t use a library like TMail that does parsing for you, but feel free to use any non-email specific libraries you want to.
The post I Am Looking To Split My Single-function C Business Calculator Program Into Numerous Functions. appeared first on Smashing Essays.