Unix awk script

Hi, I am stuck on this problem if anyone can help

Write awk.script that calculates which continent (Europe, Asia or America) has the largest population density based on the given input. America corresponds to two areas in the file, North and South. The script also produces the following output:


[FONT=Courier New, monospace]Based on [/FONT][FONT=Courier New, monospace]countries.txt[/FONT][FONT=Courier New, monospace],[/FONT][FONT=Courier New, monospace][/FONT][FONT=Courier New, monospace]continent with the largest population density is[/FONT]


[FONT=Courier New, monospace]Asia[/FONT][FONT=Courier New, monospace]: population density = [/FONT][FONT=Courier New, monospace]866[/FONT][FONT=Courier New, monospace]/[/FONT][FONT=Courier New, monospace]1411 [/FONT][FONT=Courier New, monospace]=[/FONT][FONT=Courier New, monospace] 0.6137[/FONT]


Information in blue color was calculated based on the following countries.txt file (format is
country square population area):
[FONT=Courier New, monospace]Canada 3852 25 North[/FONT]
[FONT=Courier New, monospace]USA 3615 237 North[/FONT]
[FONT=Courier New, monospace]Brazil 3286 134 South[/FONT]
[FONT=Courier New, monospace]India 1267 746 Asia[/FONT]
[FONT=Courier New, monospace]Mexico 762 78 North[/FONT]
[FONT=Courier New, monospace]France 211 55 Europe[/FONT]
[FONT=Courier New, monospace]Japan 144 120 Asia[/FONT]
[FONT=Courier New, monospace]Germany 96 61 Europe[/FONT]
[FONT=Courier New, monospace]England 94 56 Europe[/FONT]

Replies

  • MaRo
    MaRo
    What's your question?

    If it's your homework no one will make it to you!

You are reading an archived discussion.

Related Posts

"Shop vacs" are vacuum cleaners designed to be used outdoors or in work shops. Generally, shop vacs collect debris in a large dust bin instead of in a dust bag....
Is there any unidirectional sonar......
hello people, i have three problems if someone could help 1. what is the command to put pixel in DEV-CPP. because it does not have graphics.h and i dont know...
hiiiiiiiii ,friends .i want some minor projects idea of mechanical engg. or a site abt it plz help me ....byeeeeee
I have been given a project of making a DMA (Direct Memory Access) controller using verilog HDL. I know the basic concepts of DMA. But I need help as I...