- 0
Need help using a file (C++)
Asked by
shadowhawk2020,
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By pradeepviswav · Posted
Qualcomm's new Snapdragon Reality Elite chip brings on-device AI to Android XR devices by Pradeep Viswanathan Qualcomm has been delivering dedicated SoCs for mixed reality and spatial computing devices for several years. The journey started with the Snapdragon XR1, followed by the Snapdragon XR2 in 2019, the Snapdragon XR2 Gen 2 in September 2023, and finally the Snapdragon XR2+ Gen 2 in 2024. Today, Qualcomm announced a major upgrade with the new Snapdragon Reality Elite Platform, which targets premium mixed reality and spatial computing devices. OEMs can use this SoC to power both all-in-one video-see-through headsets and lightweight, tethered optical-see-through glasses. Qualcomm highlighted that the Snapdragon Reality Elite will power the next wave of Android XR devices coming later this year. These wearables will offer better visuals, improved power efficiency, and deeper on-device AI integration compared to the previous generation. The Snapdragon Reality Elite can deliver up to 48 TOPS of AI performance, allowing large language models and large vision models to run directly on the device for the first time. In addition to enabling new spatial AI experiences, these new AI capabilities will improve head and hand tracking, as well as see-through features. On the performance side, the Snapdragon Reality Elite offers up to 60% higher GPU performance, up to 30% higher CPU performance, and up to 160% higher NPU performance compared to the previous generation. The platform supports visuals of up to 4.4K per eye at 90 frames per second for sharper images and smoother motion. Qualcomm is also claiming significant efficiency improvements. The Snapdragon Reality Elite can offer up to 20% longer battery life under the same workload. More importantly, the chipset can run up to 12 degrees Celsius cooler under load, making headsets more comfortable for users to wear for longer periods. The platform also includes improvements to video see-through, featuring lower latency and better image quality. Qualcomm states that its EVA hardware block helps accelerate demanding computer vision workloads, improving how digital content blends with the real world. -
By Nas · Posted
Umm... GitHub continues to use AWS. That's the story, that's the headline. There's no "new" news here. GitHub continues to require additional capacity beyond the originally-planned Azure allocations. There's nothing special about this; nothing noteworthy. They're still using AWS' infra until the cutover is complete. -
By goretsky · Posted
Hello, Also known for https://www.theguardian.com/technology/2009/jan/29/adware-internet. Regards, Aryeh Goretsky -
By goretsky · Posted
Hello, I have used a few TEAM Group SSDs, USB flash drives, and Micro SDXC cards in the past. They all seemed to work fine. Regards, Aryeh Goretsky -
By vjlex · Posted
"just $100 per TB"? Just? Are we trying to make this seem like the new normal? Kinda weird to make it sound like that is not a ridiculously expensive asking price.
-
-
Recent Achievements
-
vjlex earned a badge
Collaborator
-
Dys Topia earned a badge
Reacting Well
-
NovaEdgeX earned a badge
Conversation Starter
-
Console General earned a badge
One Year In
-
Twozo Technologies earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
shadowhawk2020
I decided to take an online C++ class, and at first I was doing well but now I seem to be behind. I have read the chapters a few times and think I may have this one but I am probably completely off base. Here is the problem:
Design an algorithm that will read a file of employee records and produce a weekly report of gross earnings for those employees. Fross earnings are earnings before tax and other deductions. Each input record contains the employee number, the hours worked, and the rate of pay. At the end of the report print the total gross earnings for that week.
He did not give us a file to input from so it is hard to check to see if it worked. Here is what I have so far:
#include <iostream> #include <cstdlib> #include <fstream> #include <iomanip> using namespace std; int main() { {float GrossEarnings, TotalGrossEarnings, rate; int hours; unsigned int EmployeeNumber; ifstream infile; // Declare file stream named infile. infile.open ("grossearnings.txt",ios::in); //Oppem file for input TotalGrossEarnings = 0.0; GrossEarnings = 0.0; rate = 0; hours = 0; cout << "This is the Employees Gross Earnings:\n"; if (infile) // If no error occurred while opening file { cout.setf(ios::fixed); cout << "The number in the data file are as follows:\n" << setprecision(1); do { infile >> EmployeeNumber >> hours >> rate; // Get number from file. cout << EmployeeNumber << GrossEarnings << endl; GrossEarnings = rate * hours; } while(EmployeeNumber != 0.0); TotalGrossEarnings = TotalGrossEarnings + GrossEarnings; cout << "Total Gross Earnings are:" << TotalGrossEarnings <<endl; system ("PAUSE"); return 0; }}}Am I completly off base? Thank You!
Shadow
Link to comment
https://www.neowin.net/forum/topic/878628-need-help-using-a-file-c/Share on other sites
5 answers to this question
Recommended Posts