Analisando propostas

Exercício de Faculdade

Publicado em 21 de Maio de 2021 dias na TI e Programação

Sobre este projeto

Aberto

Sou estudante nós EUA, e preciso de uma ajuda com uma tarefa de casa de programação. É Uma matéria facultativa, mas que eu preciso passar. O pedido do professor está transcrito no contexto geral do projeto.

Contexto Geral do Projeto

[11/5 01:14] Isa Aiesec: Assignment 1 - Interactive Input and Output, File Input, Expressions, and Defined Constants Description You live in the Czech Republic, where the currency is the koruna. The koruna, like most currencies, is valued against the dollar differently over time. You find that on January 1 in one particular year that 42 korunas are worth one U.S. Dollar. A year later you discover that one U.S. Dollar is now worth 37 korunas. Write an interactive program that prompts the user for how many korunas the user has in a savings account, and calculates the difference in the number of U.S. Dollars between the first year's rate and the second year's rate. In this assignment, you develop a program to convert currency from korunas to dollars at two different exchange rates. This program is to be written so that input is interactive (obtained from the user), and some of the output (the "report") is printed directly to a disk file (see specs below for naming convention). Specifications The interactive portion of the program (which appears on the screen) should follow the following sample dialog (the italicized value of 30000 is a sample input value) [there is no blank line before the *** line]:: *** Koruna Exchange App *** How many korunas do you have in your savings account? 30000 The exchange information for 30000 korunas is now being recorded. The "recorded" output (that which is sent to the disk file) should appear exactly as specified below (only the values will change based on what was input during the interactive portion). Note that in the interactive portion, you will assume whole korunas (no decimals) and will display 30000 as 30000 (not 30000.00). The "recorded" output for this particular amount should appear as follows (there is no blank line at the top of the file): For 30000 korunas: At the rate of 42 korunas per U.S. Dollar, you have 714.29 U.S. Dollars. At the rate of 37 korunas per U.S. Dollar, you have 810.81 U.S. Dollars. The difference is 96.53 U.S. Dollars. Note that there should not be any extra leading spaces in front of the dollar amounts. Also, do not assume that the first koruna rate is necessarily larger than the second. The difference should appear always as a positive number. To do this, you will need to determine the absolute value of the difference. Absolute value of a number is that same number expressed as a positive number (in other words, it gets rid of the negative sign). So the absolute value of -3.8 is 3.8 and the absolute value of 4.5 is 4.5. You will need the absolute value function for float numbers. Remember how we did the floor() function in class? How it used a single argument in the parentheses and returned an integer to the expression in which it was used? Well, now you will be using the floating point absolute value function; it is called fabs() and has a single float argument. The float value it returns is the absolute value of the argument. It is in the math.h library file so think about what you need to do at the top of your program to use it. And there are a couple of ways you can use fabs(), depending on how you write your program. To get comfortable with it, write a little baby program that inputs a number from the user and prints the absolute value. Try that program with several positive and negative values. Please note the line spacing above. There is a blank line between the first 5 lines and the "difference" line. Incorrect spacing will reduce your score. For full credit, you should use defined constants to represent the two exchange rates throughout the entire program (including the output statements). Do not read the exchange rates in as input values. You may assume these exchange rates are always integer values (not real life, but I'm trying to make it easy for your first program!) And keep it simple; let the computer do any "math" necessary. Be sure to include appropriate comments and indentation in your source code. Follow the examples in the text and the sample programs that include comments. Do not change the specs of this program or your grade will suffer! An important lesson to be learned in programming is to follow the specs exactly. So, for instance, do NOT print the report section of the output to both the screen and to the file in your final submitted version. Don't change the wording or the spacing of the lines. I want you to be meticulous! Important Warning Do not use tabs or the \t character in your program source code or in your output statements. They will mess up your alignment when run on a different computer. Use the space bar to space things out in both your output statements and when typing your source code. When you originally set up your C environment, I had you disable tabs and to not keep trailing spaces. If you didn't do this, please review the appropriate section in Module 2. This is critical, or your source code will be improperly spaced and lined up. And your program may not work properly with a text data file. If you make sure these are set properly, you can then use the tab key on your keyboard. It will not generate a tab character though; it will generate spaces as if you had pressed the space bar. What You Are Expected To Submit For this assignment, I want you to develop both a pseudocode design for the program, and the C program itself. You will not be turning in the pseudocode design. You WILL turn in the C source code file (the .c file) and the output disk file output (the .txt file). Your source code external filename should be YOUR first initial and last name and the addition -ke (meaning koruna exchange) plus the .c extension (as an example, it would be kjefferies-ke.c for me). Please also make sure that you submit the source code file with the extension of .c, not .cpp. Your output text file external filename should be YOUR first initial and last name and the addition -ke (meaning koruna exchange) plus the .txt extension (as an example, it would be kjefferies-ke.txt for me). Your program should write this file directly to the c:\class folder on your hard drive. You will need to create this folder (all lower-case letters) PRIOR to developing your program. You may do so via Windows Explorer, or by going to the Windows command prompt and using the md command (e.g. Md c:\class then pressing the enter key). [Note: This step is required because Windows does not allow writing directly to the root folder of C:\.] So in the end, your program will create a file called similarly to: c:\class\kjefferies-ke.txt (using YOUR name as described above). Also, remember there's something special you need to do in the fopen() command in your program in terms of specifying the filename. Please submit BOTH the source code file and the output disk file in the assignment submission area of the assignment posting by uploading them. Do not submit the .exe file (the "executable"). Make sure you have uploaded BOTH files prior to pressing Submit in the submission area. Please follow the same basic steps you saw in the How to Submit video for Assignment 0. Please do not submit any extra files other that the ones I listed above. Also, please follow the naming conventions dictated above. Failure to do so will cause you to lose points. To test your program, run it at least with two different sets of input data: once with 30000 for the input value and once with 5000 as the input value. Submit only the report file from the run which uses 30000. Remember, with each run only the data should change; the program should not at all have to be altered for both data values to work correctly. Check your answers carefully! Important: the program should work for ANY whole koruna value from 0 up to 10000000. For numeric values, use only the data types discussed in the lecture materials (int, float), and be certain you use the correct types! Review what range of values are appropriate for each type and for your particular version of Dev C++ (32 vs 64 bit). Notes This is your first C program, so please do not panic! At the same time, I (like your boss) will be picky about output spacing and following the specs, so make sure you do so. If there are any questions, please use Ask Your Instructor a Question in Canvas. Please work independently from other students, and please do not be tempted to subvert your knowledge by cheating. Best of luck, and have fun! [11/5 01:14] Isa Aiesec: Current Ratio Assignment Specifications In this assignment, you develop a program to produce a current ratio report. The current ratio is used in accounting to measure a company's financial condition. To compute the ratio, one divides the company's current assets by the current liabilities. Here is a sample set of data (2010 to 2012). The first line is the company name, appearing in column one (a maximum of 30 characters in length). In each subsequent line, the first number (starting in column 1) represents the current assets and the second number (starting in column 10) represents current liabilities. Here is some sample data to use (no blank line appears in the data file at the beginning):: Hi-Tech Leisure Products 47900 31007 34500 9100 57984 14822 You should write a batch (file input) program that reads this data in this format (laid out as you see it above, on four lines) from a textfile, then produces a report (sent to a disk file) that displays it along with the current ratio for each year. Assume 2010, 2011, and 2012 are the three years in question. Here's sample output for the data you see above: Hi-Tech Leisure Products Current Ratio Report Current Current Current Year Assets Liabilities Ratio ---------------------------------------------------------- 2010 47900 31007 1.54 2011 34500 9100 3.79 2012 57984 14822 3.91 ---------------------------------------------------------- Average 46795 18310 3.08 This report produced by Raul Jimenez. The data will allows be whole values (no cents), but may run into the millions. No cents are to be displayed. The current ratio will always be displayed rounded to two decimal digits, and could be up to 9999.99. The averages are rounded to the nearest whole dollar. You must create the data file in the manner discussed in the lecture. Note that the various asset and liability numbers could be 5 digit, 4 digit, or even 3 digit or 6 digit. The numeric formats you use to print should not vary based on what you see for this particular set of sample data. Your program should be able to consistently produce a properly aligned report with all different sizes of numbers without changing the code! Please be careful in noting how things are aligned. The "t" in "Current" is over the last digit of each number. Proper and exact alignment of all elements of the report will be part of your score. The program must be written using modularity (voided functions), which is this week’s topic. If you do not build this program using void functions, major points will be deducted. Replace Raul Jimenez with your name. You can “hard-code” this into the statement; it won’t be necessary to use a defined constant for this. Warning: Be careful with your calculations. The average current ratio (at the bottom of the table) is the average of the three current ratios, not the quotient of the average assets and average liabilities. The wrong algorithm will cost you major points. Hint You will need to use fgets() instead of fscanf() for the name of the company. Fscanf() cannot read a string with embedded spaces. What You Are Expected To Submit For this assignment, I want you to develop (but not turn in) a full top-down design including a Hierarchy Chart, and a Nassi-Schneiderman Chart for each module box. You will submit only the source code file (.c) and the unaltered (ahem!) output file (.txt) from your run of the program. Place your name in the comments of the source code file and make sure your program prints your name in the last line of the report in the output file. Do not zip the files. And please, use .c for the source code and .txt for the output file. No Word documents or other such formats. In the program itself: * Your source code filename should be YOUR first initial and last name and the addition _cr plus the .c extension (such as kjefferies_cr.c for me). * Your external filename for the input file must be c:\class\current.txt. * Your external filename for the output file should be YOUR first initial and last name and the addition _cr plus the .txt extension (such as kjefferies_cr.txt for me). Please use these filenames and the c:\class directory; it will make your programs much easier for the reader to score. You will need to manually create the class folder under the c:\ folder. Submit only one test run (output file) of your program, using the data shown above. Check your answers carefully! (especially the current ratio calculation) Be sure to include appropriate comments and indentation in your source code. [11/5 01:15] Isa Aiesec: Assignment 3 - Looping, Modularity, Expressions, File Input, File Output Assignment Specifications In this assignment, you develop a program to produce a transaction report. Details are given in the specs below. This program is to be written so that input is from a file (batch input), and the output is text that is printed to a disk file. The program must be written using void functions and the appropriate type of loop structure. You will not receive full credit if you do not use void functions. Do not write the program using selection structures (e.g., If/else), as we have not covered these yet, and they are not needed for this program. You will need to create a data file (for input) on disk (as you did in the previous assignment). Use the sample data found in the specs for this file for your submission run. Specifications You are writing this program for the owner of a small business that deals with transporting goods. He wants to utilize the computer for the keeping of records, plus doing a bit of analysis. He is maintaining an operating account and would like to figure out the net balance of money after purchasing goods and selling goods, plus keeping track of various incidental charges. Someone will be entering each of the transactions into a textfile. You will write a C program to read this file and produce a report. This program should read a transaction type that it one of the following: take in cost of a product brought into inventory (negative number) ship out price of a product sold and removed from inventory (positive number) fee miscellaneous fee paid (negative number) tariff tariff charged by receiving country (negative number) handling charge to the customer for handling (positive number) this string is followed by some amount of money (dollars and cents) that belongs to that transaction. The number may be positive or negative; that is determined by the type of transaction to which it is attached, so there is no need to determine the sign of the number using selection. Your program should keep track of the running total (net) of these figures. The operating account always starts with a balance of $1000.00 (might change every great once in a while). Here is some sample input (the string begins in column one of the textfile). It is unknown how many lines of input there are (this easily varies from run to run). All lines are structured similar to these: take in -2325.19 ship out 4735.41 Tariff -117.88 take in -5100.25 Fee -510.00 ship out 7432.44 handling 250 take in -500.34 take in -3333.44 FEE -150.00 (Note: The data file starts with the first line of data, not with a blank line. The amount always starts on or after column 11.) Here is some sample output, based on the sample input above. The first line of output is the line with “Turtle Bay Traders”; do not output a blank line before it. Turtle Bay Traders 4800 Palawan Way Mandalay Beach, CA 99499 Operating Account Starting Balance: 1000.00 Transaction Amount Net ----------- ------ --- take in 2325.19 -1325.19 ship out 4735.41 3410.22 Tariff 117.88 3292.34 take in 5100.25 -1807.91 Fee 510.00 -2317.91 ship out 7432.44 5114.53 Handling 250.00 5364.53 take in 500.34 4864.19 take in 3333.44 1530.75 FEE 150.00 1380.75 Operating Account Ending Balance: 1380.75 There were 10 transactions processed. (Note: In the actual output, the first line into the output file is the "Turtle Bay Trader" line; there is no blank line in the output file before it.. You may assume that any of the transaction types are no longer than 10 characters in length. (Remember what you have to do for the declaration.) But make sure your program can also handle transaction types that are less than that length Also, note that the number appearing on the report in the Amount column MUST be represented as a positive number, no matter what the actual transaction amount is. In both the header and the summary, the balance should appear with the decimal point aligned with the decimal points in the Net column in the middle section of the report. The ending balance could be a negative number. The number of transactions processed should appear in the sentence without any extra spaces before it (in other words, only one space after the word "were", no matter what).. Make sure that your columnar alignment in the report is EXACTLY what you see above. Don't try to "correct" anything you see above, such as the alignment of the headers. What You Are Expected To Submit For this assignment, I want you to develop (but not turn in) a full top-down design including a module structure chart, and a Nassi-Shneiderman chart for each module box. Then, of course, develop and test the actual program. Submit the following: source code file (.c) and the output file from the test run of your program, using the data shown in the specs. Check your answers carefully! Your source code filename should be YOUR first initial and last name and the addition _tr plus the .c extension (such as kjefferies_tr.c for me). Your external filename for the input file must be c:\class\transactions.txt If you have not yet created a c:\class folder for your data and output files, then do so prior to working on this program. Your external filename for the output file should be c:\class\ plus YOUR first initial and last name and the addition _tr plus the .txt extension (such as c:\class\kjefferies_tr.txt for me). You must use these filenames and filename conventions and the c:\class directory to receive full credit. Do not submit your input file or .exe file. Be sure to include appropriate comments and indentation in your source code. You will continue to be graded on style. [11/5 01:16] Isa Aiesec: Assignment 4 - Modularity, Looping, Selection, File and Interactive Input, Concatenation Assignment Specifications Overview You are the owner of a small but growing IT network consulting firm, consisting of several staff members, some of which are employees and others are contractors. The company is always working on several client projects, each of which might have anywhere from 1 to 15 (or more) team members. You are developing a weekly Staff Member Earnings Report Generator application. The user will interactively enter information for each staff member, including their first name and last name, hourly wage, and number of hours worked. The program should create a report as this information is entered. The report will be stored in a sequential disk file in text format. The report generated by the application will include the information entered by the user, plus will show both the regular and overtime hourly wage, regular and overtime pay for the period, and a total pay for the period. The overtime rate is 1.5 times the regular rate, although the legislature is considering changing this within the next year or two. Overtime is currently paid for any time over 40 hours during the period; however, this might change too. User Interface Specifications Here is a sample dialog. Your spacing and wording should be the same as it is here. Please note that the yes/no answer in response to "Process another employee?" is a single character, and can be Y, y, N or n. No validation is necessary in this program, so assume that the user types a valid response (one of the ones just mentioned). NetworkHaus Information Technology, LLC Staff Earnings Report Generator Please enter the project name: MFS Server Enter staff member #1's first name: Monique Enter staff member #1's last name: Fabre Enter the hourly wage of Monique Fabre: 37 Enter total number of hours: 60 Thank you. Process another employee? Y Enter staff member #2's first name: Steve Enter staff member #2's last name: Kim Enter the hourly wage of Steve Kim: 32 Enter total number of hours: 57.5 Thank you. Process another employee? y Enter staff member #3's first name: Juan Carlos Enter staff member #3's last name: Jimenez Enter the hourly wage of Juan Carlos Jimenez: 34.50 Enter total number of hours: 40 Thank you. Process another employee? Y Enter staff member #4's first name: Claire Enter staff member #4's last name: St. Marie Enter the hourly wage of Claire St. Marie: 9.75 Enter total number of hours: 21 Thank you. Process another employee? y Enter staff member #5's first name: Jack Enter staff member #5's last name: Hadjian Enter the hourly wage of Jack Hadjian: 28.30 Enter total number of hours: 62 Thank you. Process another employee? n End of processing. Report File Specifications Please follow these rules precisely for full credit! Your output should appear identical to that shown below (same horizontal spacing and everything) given the exact same sample input. If lines are missing or values are off or spacing is different, your score will take a hit. Assume that the project name is one or more words, 20 characters long maximum, with possible embedded spaces. Each of the two names requested is limited to a logical length of 14 characters, and either name may or may not have spaces. Think about what these variables need to use for the declared size, as well as the string variables that will contain the combined names and any extra space / punctuation. You must use the guideline I've been discussing all term, which is the logical length plus 1 (for declaration). Note that you will have to somehow create both a combined display name and a combined name for the report (in a different format). You'll have to do a little thinking to figure out how to get the report name lined up so that no matter what length, your report will be properly aligned. The first hint is that it involves joining strings together, something called concatenation. Give it a go, and if you can't figure it out, look at the next document in this folder; it contains additional hints. Part of the purpose of this assignment is to implicitly teach you concatenation. Do NOT use tabs (\t) and make sure your Dev C++ Editor Options specifies to NOT use Tab characters. In essence, all numbers appearing in the report should be right-justified and decimal-aligned. All numbers appearing in the summary should appear "conversationally" without leading spaces (other than the one which normally separates the number from the previous word). Hourly wage amounts CAN be less than 10.00, so be very careful with your formatting. You may assume that there are no regular wages for a staff member that exceeds 60.00, and that no gross is ever over $9999.99. You may also assume that Total hours per week for an employee never exceeds 80. The sample output can appear correct, but you can still be docked up to a point and a half if things aren't aligned properly (the more misaligned, the higher the deduction). Remember everything I've taught you about formatting items in a report. Your report should remain aligned without the need for any adjustments as long as the input values are within the value range/length. Your calculated amounts in the report should NOT be off by one cent. Since we are all using Dev C++, you should end up with the exact same results as below. Here is the report that would be developed from the sample input above. The output should be written to the file similar to your previous assignments (c:\class folder and with the filename having your first initial and last name with a -er at the end). For instance, if I were submitting the assignment as a student, my file would be c:\class\kjefferies-er.txt on the hard disk. . Your output file should START with the company name line; there is no blank line before it. NetworkHaus Information Technology, LLC Weekly Staff Earnings Report Project: MFS Server Staff Member Reg Hrs Overtime Hrs Gross ------------------------------------------------------------------------ Fabre, Monique 40.0 ($37.00) 20.0 ($55.50) $2590.00 Kim, Steve 40.0 ($32.00) 17.5 ($48.00) $2120.00 Jimenez, Juan Carlos 40.0 ($34.50) 0.0 ($51.75) $1380.00 St. Marie, Claire 21.0 ($ 9.75) 0.0 ($14.63) $ 204.75 Hadjian, Jack 40.0 ($28.30) 22.0 ($42.45) $2065.90 ------------------------------------------------------------------------ Total Regular Hours Worked: 181.0 Total Overtime Hours Worked: 59.5 Percentage of Total Hours That Are Overtime: 24.7% Total Regular Wages: $5476.75 Total Overtime Wages: $2883.90 Total Wages This Period: $8360.65 Compiler bug workaround (critical and mandatory!!!) all compilers have bugs and quirks. Dev C++ happens to have a problem with any gets() that occurs after a scanf(). For your program to work, you MUST include the following function definition in your code: int clear() { while ((getchar())^'\n'); // yes, this is a loop with no body! } Don't forget to also include a function prototype for this function. This function should be called immediately following the scanf() that reads the answer to the "Process another staff member? question. Please use a char variable (not a string) for that response, similar to how we did it in Module 5. Such as: printf("\nThank you. Process another staff member? "); scanf("%s", &answer); clear(); // this is the line you must include If you do not place the clear() there, your program won't read the next name properly and you will be VERY frustrated. What You Are Expected To Submit For this assignment, I want you to develop (but not submit) a full top-down design including a module structure chart, and a Nassi-Shneiderman chart for each module box. And then produce your C program. Submit to the submission area the source code file (the file should be named with your first initial and last name with –er.c appended to it [for example, mine would be called kjefferies-er.c]) and the output file (the .txt file) from the sample run. Although you should do the design, you won't be required to hand it in. However, you are welcome to submit it (non-graded basis) either in class or scan it and submit it with your code. I’ll comment on it. Don't worry about "submitting" the interactive portion of the output; I'll just look at your code for that (and possibly compile and execute your code). Be sure to place your name in the source code file somewhere near the top in a comment. Use the sample input shown above to test your program. Submit the output from that run. Check your answers carefully, and be sure try the program with alternate data also to make sure things always look good!. Be sure to include appropriate comments and indentation in your source code. Think about the style tips we've discussed in previous lectures and include what you can to make your program easy to read and flexible. I may test your code to make sure it produces the correct output. For this reason, you should make sure your source code file has the extension of .c instead of .cpp or some other extension. I will score and comment only the last submitted version of this program that is submitted prior to the due time and date.. start on this program immediately. It is not one that can be understood and written the same day as the due date! I’m giving you about two weeks to do this, and you will need the time. START EARLY!

Categoria TI e Programação
Subcategoria Programação
Qual é o alcance do projeto? Alteração média
Isso é um projeto ou uma posição de trabalho? Um projeto
Tenho, atualmente Eu tenho especificações
Disponibilidade requerida Conforme necessário
Funções necessárias Desenvolvedor

Prazo de Entrega: 23 de Maio de 2021

Habilidades necessárias

Outro projetos publicados por R. C. D. O.