Efficient C++ Data Read/Write Program for Employee Pay Increase Calculation

  • Context: Comp Sci 
  • Thread starter Thread starter jimmyv12
  • Start date Start date
  • Tags Tags
    C++ Data
Click For Summary
SUMMARY

The discussion centers on a C++ program designed to calculate and write employee pay increases to a file. The user encountered issues where the pay increase percentages for the second and third employees were incorrectly assigned, resulting in duplicated values. The problem was resolved by rewriting the input file, which corrected a typo that was causing the errors in data processing. This highlights the importance of careful data handling and debugging in programming.

PREREQUISITES
  • Understanding of C++ programming language
  • Familiarity with file I/O operations in C++
  • Basic knowledge of data structures for storing employee information
  • Experience with debugging techniques in programming
NEXT STEPS
  • Explore C++ file handling techniques for efficient data management
  • Learn about debugging tools and methods in C++
  • Investigate data structures for managing collections of employee records
  • Study best practices for input validation in C++ applications
USEFUL FOR

Programmers, software developers, and students learning C++ who are interested in file handling and debugging techniques for data processing applications.

jimmyv12
Messages
10
Reaction score
0
Alright, so basically I'm writing a program that will copy three people's first and last name, current pay, and pay increase %. Then, write it to a file that gives their name, and new pay after the increase has been applied to the current pay. When I launch the program, then open the output file to see if it worked, person one works fine, then, for person two, it gives the name, and pay increase, but with person one's %. Then person three is just a copy of person two.

Is there anything I need to add in between each person's code to help fix this? I would show my code but I have no idea how to copy it from pico(I'm using telnet with my school). So if anyone would like to see the code and knows how to do that, I'll happily show the code.
 
Physics news on Phys.org
okay nevermind I figured it out, I just had to re-write the input file because I guess I had a typo
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
7
Views
3K
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K