Here is the code I have come up with for this week, when I run it it reads the same record over and over, and never stops. I am sure I just did some stupid mistake, but I have been working on this so long today, my eyes are going to bleed.
It saddens me when cars are such dull colours now. Mine is bright metallic blue and I absolutely adore it for standing out in contrast to that depressing backdrop of traffic.
Sparkle 2.20.0 by Razvan Serea
Sparkle is a free, open-source Windows optimization tool designed to make your PC faster, cleaner, and more private. With Sparkle, you can easily debloat Windows by removing unnecessary apps and services, disable Microsoft tracking to enhance privacy, and apply performance tweaks to boost speed. Its cleaner removes junk and temporary files, while every change is safe and fully reversible. Sparkle also features a modern, user-friendly interface with automatic updates, making system maintenance simple. Explore over 39 tweaks, from disabling telemetry and hibernation to optimizing network and game settings, all aimed at customizing and enhancing your Windows experience.
Sparkle supports Windows 10 and 11.
Sparkle 2.20.0 changelog:
Debloat Tweak has animated border
New homepage loading UI
New Tweak Modal (Markdown Supported)
Refactored GPU Detection
Added Tests with vitest
Added foobar2000 to apps
Added Localsend to apps
Updated Modal Styles
Added styles for disabled inputs
Added Animated Border to debloat-windows tweak
Bumped dependencies
Refactor System info logic for speed
Tweak info modals now support Markdown
Added Clear System info cache to settings
Redesigned Home Page Loading UI
Changed Some Icons around the app
Download: Sparkle 2.20.0 | Portable | ~100.0 MB (Open Source)
Links: Sparkle Website | Github | Screenshot
Get alerted to all of our Software updates on Twitter at @NeowinSoftware
Question
shadowhawk2020
Here is the code I have come up with for this week, when I run it it reads the same record over and over, and never stops. I am sure I just did some stupid mistake, but I have been working on this so long today, my eyes are going to bleed.
//Jason Watson //SPD_6_5 #include <fstream> #include <iostream> #include <cstdlib> #include <iomanip> using namespace std; int main () { float TotalTax, TotalGrossEarnings, TotalMedicalLevy, TotalEarnings; TotalTax = 0; //Set TotalTax to 0 TotalGrossEarnings = 0; //Set TotalGrossEarnings to 0 TotalMedicalLevy = 0; //Set TotalMedicalLevy to 0 TotalEarnings = 0; //Set TotalEarnings to 0 short hours, rate, employeenumber; cout <<"Employeee earnings and medical levy report: "<< endl << endl; //Display Heading cout <<"Emp #"<<setw(11)<<"Gross"<<setw(14)<<"Tax"<<setw(16)<<"Levy"<<setw(13)<<"Net"<<endl<<endl; //Read Employee Record ifstream empfile; empfile.open("empfile.txt",ios::in); //Open File if(empfile) //Check For Error { empfile >> employeenumber >> hours >> rate; do { TotalGrossEarnings += hours*rate; //Calluclations TotalTax += hours*rate*0.15; TotalMedicalLevy += hours*rate*0.01; TotalEarnings += (hours*rate)-((hours*rate)*0.15)-((hours*rate)*0.01); cout.setf(ios::fixed); cout<<employeenumber<<setw(15)<<setprecision(2)<<hours*rate*1.00; cout<<setw(15)<<hours*rate*0.15<<setw(15)<< hours*rate*0.01; cout<<setw(15)<<(hours*rate)-((hours*rate)*0.15)-((hours*rate)*0.01)<<endl<<endl; empfile >> employeenumber >> hours >> rate; } while (!empfile.eof()); empfile.close(); //Close Employee file cout << endl; cout << "Total Groass Earnings: " << TotalGrossEarnings << endl; cout << "Total Tax: " << TotalTax << endl; cout << "Total Medical Levy: " << TotalMedicalLevy << endl; cout << "Total Earnings: " << TotalEarnings << endl << endl; } else {cout << "Error opening data file" << endl;} cin.get(); return 0; }Thank you for any help you can give
Shadow
Link to comment
https://www.neowin.net/forum/topic/881050-c-homework-what-am-i-doing-wrong/Share on other sites
5 answers to this question
Recommended Posts