Help to find the max, min and the averages wages
ok i did sum programming i got half of my program to work but i need help with the other half the program is suppose to find the highest and lowest wages and also give the average wages. here is my code
import java.util.*;
public class WorkerwagesQueues
static Scanner console = new Scanner(System.in);
public static void main (String[] args)
Queue<String> nameQ = new LinkedList<String>();
Queue<String> nameQ2 = new LinkedList<String>();
Queue<Double> num = new LinkedList<Double>();
int searchCnt = 0;
int max, min;
String toSearch, var;
System.out.println("Welcome, how are you Doing today\n");
System.out.println("Please enter the five workers names\n");
for (int i = 0; i < 5; i++)
nameQ.offer(console.next());
System.out.println("Please enter the five workers salaries\n");
for (int i = 0; i < 5; i++)
num.offer(console.nextDouble());
// starting right here is my problem
/*min = num.next(0);
max = num.get(0);
for (int i = 0; i < num.size(); i++)
System.out.println(num.get(i));
if (i > 0)
if (min > num.get(i))
min = num.get(i);
if (max < num.get(i))
max = num.get(i);
System.out.println("\nthe Lowest wage is " + num );
System.out.println("\nthe Largest wage is " + num );
System.out.println("please enter a name to serach the queue:");
toSearch = console.next();
while (nameQ.size() > 0)
var = nameQ.remove();
if (var.equals(toSearch))
{searchCnt++;}
else
{nameQ2.offer(var);}
System.out.println("This queue contains " + toSearch + " " + searchCnt + " time(s).");
System.out.println("The second queue is:");
}
ok sorry if i am annoying you guys but i really want to get this working
this is the part i am having problems with. I am trying to find the max and min of the wages the user input and i am not usre how to do it. my question is how do i do that?
// starting right here is my problem
/*min = num.next(0);
max = num.get(0);
for (int i = 0; i < num.size(); i++)
System.out.println(num.get(i));
if (i > 0)
if (min > num.get(i))
min = num.get(i);
if (max < num.get(i))
max = num.get(i);
System.out.println("\nthe Lowest wage is " + num );
System.out.println("\nthe Largest wage is " + num );
Similar Messages
-
How to Display MAX, MIN and AVG in ALV
Hello Friends,
Can some one help me with MAX, MIN and AVG in ALV..
I am displaying a screen with ALV.. it displays 3 columns..
below every column i have done .. summatation with the help of
FIELDCATALOG-DO_SUM = 'X'.
is there any way in which i can find out MAX, MIN and AVG of each column ?
Thanking you in Anticipation.
Best Regards,
Jitesh PNO at the bottom of the screen ..
Just below the summation.
column 1 column2 column3
10 20 30
11 21 30
12 22 30
Sum 33 63 90
Max 12 22 30
min 10 20 30
AVG 11 21 30 -
I have an IPhone 4 and downloaded 12 songs from the Itunes store on my phone. I want to burn a CD but when I go into my ITunes on my desktop which is Windows XP there are only 7 listed not the 12 I bought. Can anyone help me find the others?????
Connect iPhone, then go to iTunes > File > Transfer purchases...
-
i have my daughters iphone 3, i want to use it as an i-pod, but it keeps receiving messages from some her friends is there a way to stop this from happening, please help, my phone is maxed out and would really like the storage for music, thanks
It sounds like it still has her information on it, so it might be efficient to navigate to Settings, then General, then Reset, then Erase All Content and Settings. You can then set up the phone again, using your information. This way the phone will be yours, officially, and her data and information will be removed.
-
I can't find photos imported from my iPhone 4 with "Image Capture" to iPhoto anywhere... and they were deleted from the iPhone after import! Can anyone help me find the photos?
Do you know the date they were taken? Try search on that.
Regards
TD -
find an iphone 5 in the club and i want you to help me find the owner and return it to the user.
its been erased and no sim card in it .when i try to configure , it says i should enter an apple
and a password.Since it was erased and no sim card the owner probably got rid of it of some reason.
-
I need help!
I have iPad mini and I can't use App Store.
It always asking my credit card lnformation to download, but the apps I will download are free.
I don't know how it will work again.
Help me please!
Thank you.You need to have a payment method on file. If the apps are free you will not be charged anything. Either enter your credit card information or purchase and enter an iTunes gift card.
-
Hi.I need help.my iphone was Stolen .how can I get back my iphone. Serial No.DX******PMW.could you help me find my iphone.thank you very much.could you send me the ICCID number to help me find the iphone.if you can help me.
<Personal Information Edited by Host>
Sincerely a Chinese girl really need your helpSorry we are all users on this User Community No Apple Staff
Read this .
http://support.apple.com/kb/HT2526
Apple do not and cannot assist in finding stolen property ,that is the responsility of your Police -
I need help to find the serial number for Photoshop Elements 11
Hi! I need help to find the serial number for Photoshop Elements 11 I downloaded last year on Apple Application Store.. I have been using photoshop on mac for over a year and now need the serial number to be able to use it on macbook. I looked up Adobe's website for help but found none and noone to ask for support.. Any ideas how I can get the serial number using the App Sore bill I have?
Please post Photoshop Elements related queries over at
http://forums.adobe.com/community/photoshop_elements -
Can someone help me find the JavaMail example code?
Hello, once I found a collection of source code files that contained example code for using the JavaMail API. Now I cannot find the collection. Is it still online? Can anyone help me find the JavaMail example code? Sorry if this question seems to easy - I've been searching for a while now without success.
Thanks in advance,
Paul HumphreyReally? You can't find it? My answer above wasn't
clear? And this FAQ entry didn't help?
http://java.sun.com/products/javamail/FAQ.html#examples
Please, tell me how I could make the answer more clear to you... -
Can Someone Help Me Find The Right KVM?
I have a tough set-up and I'm finding the search to be overwhelming. I'm hoping someone who's been through this before can help me find the best KVM for my needs. Here's what I have:
Apple Dual 553mHz G4
• Upgraded dual montior video PCI card (ADC and DVI ports)
Apple G5 QUAD
• Stock dual DVI ported video PCI Express card
Monitors
• 2 Apple 17" displays (ADC)
• 1 Wacom 18" Display (DVI)
I also have 1 Apple DVI to ADC Display Adapter
Can I find a dual monitor KVM to use between these 2-machines and leave the third monitor on the G5 only? How about 3-monitor KVM? What are my options here? I'm so confused by all of this.
i really want the G5 to be able to use all three monitors at once. It doesn't matter to me how many the G4 gets. If the KVM doesn't work I'm just going to suck it up and buy a second video card for the G5 (and DVI adapter) and run all 3 monitors on the G5 and use Remote Access for the G4.with respects to the dual DVI KVM... there are a couple of options out there.
as far as 3 monitor KVM, there really are no such products, however, there are DVI matrix swtiches that will allow you to manually (or through presets) switch any input to any output, to include mirroring monitors on various inputs. however, with anything DVI, there may potentially be hot switch issues with resolution and synch, handshake, peripheral control, etc...
let me just shoot you a couple of links...
for dual DVI KVM...
http://www.linkskey.com/detail.php?Productid=140&ProductName=LDV-DM02ESK
http://www.linkskey.com/detail.php?Productid=139&ProductName=LDV-DM04ESK
http://www.cablestogo.com/product.asp?cat%5Fid=518&sku=32562
http://www.networktechinc.com/srvsw-pc-dvi.html
DVI matrix switchers (any input to any output - very expensive)
http://www.gefen.com/kvm/product.jsp?prod_id=1464
http://www.digitalprojection.com/content/view/88/91/
sorry to just shoot a bunch of links to you. in my experience, i've generally just used VGA for KVM setups and also there are many pitfalls with compatibility in certain setups that are almost impossible to avoid without trial and error and blind luck. -
Please help me find the error in the annex VI,access
Hello, everyone, this is a program about ACCESS, please help me find the error in the annex VI, why do I always run time error. Thank you very much.
Attachments:
write access test.vi 22 KBThank you for your reply, I have an attachment process map, could you help me change it, I just want to put my number in the array can continue to update the database. And I want to create a table.
this is my msn :[email protected]
Waiting for your reply on line
谢谢你的回复,我的附件中有程序图,能不能帮我改一下,我只是希望,把我的数组中的数能够持续的更新在数据库中。并且创建一个我想要的表。 -
Help to find the driver for Satellite 1800-412
Kind time of day dear administrators of a forum and participants, help to find the driver for toshiba satellte s1800-412, beforehand thanks.
If there is an opportunity send on a mail [email protected]Hi
This is a user to user forum dude ;)
If you want accept an advice from a simply common Toshiba notebook user then got to this site:
http://eu.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/download_drivers_bios.jsp?service=EU#
Choose Archive Satellite Archive Satellite 18** - Satellite 1800-412
Enjoy ;) -
Need help to find the "leading point size"
Hi,
I need help to find the "leading point size".
Any para style leading is more than 2 points of my font size, I need the alert message "Its more than 2 points for your font size". For instance my para font size is 10 here my leading should be 12 points rather than its 14 points, I need the alert message.
Is this possible by script?
by
hasviHi Hasvi,
Try this.
var doc = app.activeDocument;
var texts = doc.stories.everyItem().textStyleRanges.everyItem().getElements();
var pstyle = "Following paragraph styles have more leadings:\r\r";
for(var i=0;i<texts.length;i++)
var ps = texts[i].pointSize;
if(texts[i].leading > ps + 2)
pstyle += texts[i].appliedParagraphStyle.name;
alert(pstyle)
If it is correct than mark the answer as correct and don't mark your question as correct answer.
Regards,
Chinna -
Help in finding the Airplay Mirroring Icon
Can anybody help with finding the Airplay Mirror Icon on Ipad 2. I've double clicked the Home Button and moved the Icons to the right. I have the Music Player buttons/ volume etc. There is a button that that has a square in it with a triangle at the base of the square. When you press this is pulls up Ipad or Apple TV choice, this only however appears to refer to the music. The picture on the Ipad- on this case Safari, desnt show on Apple TV.
Apple TV is switched on and the Ipad and Apple TV are both connected to the same network.
I have been able to click the the Airplay Icon at the top of the Photos screen when looking at photos.Oracle Documentation is the best free material for preparing for OCA Exam.
Maybe you are looking for
-
Query on material and quantity updation
I updated material and quantity updation for a particular material type and plant combination in development server. Before transpoting in transport request, when I View Cluster Maintenance: Data, I am able to see that in table T143M is also updated
-
Hi I could not give date value as a parameter in the filter option of any report.It thows following error in different situations.But my object data type is datetime only.The errors are 1. Exception Message : ADC Server exception in OpenViewset). Sta
-
Differences between Oracle Discoverer 10g and 11g .
we would like to know if they are any differences between Oracle Discoverer 10g and 11g and any issues with 10g that are overcome in 11g. Please make us aware of any merits in going for 11g over 10g. apps version 11.5.10.2 Regards
-
Hello, We would like to install an ECC 6.0 and a CE in a cluster MSCS of two nodes. I've found the SAP documentation "Installation of Multiple SAP Systems in MSCS: Oracle" but the doc version is 03/30/2007. Could you please tell me wether there is a
-
is there an adapter for going from TB on MacAir to a div displey?