SlideShare a Scribd company logo
here is my code so far but I cant get it to run properly because I keep getting an error code saying
75:14 Kotlin: Expecting ')' import java.io.File class Weather(val date: String, val precipitation:
Float, val snowfall: Float, val snowDepth: Float, val maxTemperature: Float, val
minTemperature: Float, val avgTemperature: Float, val heatingDegreeDays: Float, val
coolingDegreeDays: Float, val sunrise: String, val sunset: String, val lengthOfDay: String) fun
readData(): Map { val weatherDB = mutableMapOf () val lines =
File("weather.db").readLines().drop(1) for (line in lines) { val row = line.split(",") val date =
row[0] val precipitation = row[1].toFloat() val snowfall = row[2].toFloat() val snowDepth =
row[3].toFloat() val maxTemperature = row[4].toFloat() val minTemperature = row[5].toFloat()
val avgTemperature = row[6].toFloat() val heatingDegreeDays = row[7].toFloat() val
coolingDegreeDays = row[8].toFloat() val sunrise = row[9] val sunset = row[10] val
lengthOfDay = row[11] val key = getKey(date) weatherDB[key] = Weather(date, precipitation,
snowfall, snowDepth, maxTemperature, minTemperature, avgTemperature, heatingDegreeDays,
coolingDegreeDays, sunrise, sunset, lengthOfDay) } return weatherDB } fun getKey(date:
String): String { val (month, day) = date.split("/") return "${month.padStart(2,
'0')}/${day.padStart(2, '0')}" } fun printHeader() { println("%-10s%-15s%-10s%-10s%-10s%-
10s%-10s%-10s%-10s%-10s%-10s%-15s".format( "Date", "Precipitation", "Snowfall", "Snow
Depth", "Max Temp.", "Min Temp.", "Avg Temp.", "HDD", "CDD", "Sunrise", "Sunset",
"Length of Day")) } fun printAllRecords(weatherDB: Map ) { printHeader() for ((_, weather) in
weatherDB) { println("%-10s%-15.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%-
10s%-10s%-15s".format( weather.date, weather.precipitation, weather.snowfall,
weather.snowDepth, weather.maxTemperature, weather.minTemperature,
weather.avgTemperature, weather.heatingDegreeDays, weather.coolingDegreeDays,
weather.sunrise, weather.sunset, weather.lengthOfDay)) } } fun
printRecordsFromSingleMonth(weatherDB: Map ) { printHeader() print("Enter month (MM): ")
val month = readLine()!!.padStart(2, '0') for ((key, weather) in weatherDB) { if
(key.startsWith(month)) { println(message = "%-10s%-15.2f%-10.2f%-10.2f%-10.2f%-10.2f%-
10.2f%-10.2f%-10.2f%-10s%-10s%-15s".format( weather.date, weather.precipitation,
weather.snowfall, weather.snowDepth, weather.maxTemperature, weather.minTemperature,
weather.avgTemperature, weather ) }

More Related Content

Similar to here is my code so far but I cant get it to run properly because I kee.pdf

InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
InfluxData
 
Node.js - As a networking tool
Node.js - As a networking toolNode.js - As a networking tool
Node.js - As a networking tool
Felix Geisendörfer
 
The Ring programming language version 1.2 book - Part 26 of 84
The Ring programming language version 1.2 book - Part 26 of 84The Ring programming language version 1.2 book - Part 26 of 84
The Ring programming language version 1.2 book - Part 26 of 84
Mahmoud Samir Fayed
 
alexnet.pdf
alexnet.pdfalexnet.pdf
alexnet.pdf
BhautikDaxini1
 
Swift Ready for Production?
Swift Ready for Production?Swift Ready for Production?
Swift Ready for Production?
Crispy Mountain
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
Wiem Zine Elabidine
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
Andres Almiray
 
The Ring programming language version 1.5.1 book - Part 35 of 180
The Ring programming language version 1.5.1 book - Part 35 of 180The Ring programming language version 1.5.1 book - Part 35 of 180
The Ring programming language version 1.5.1 book - Part 35 of 180
Mahmoud Samir Fayed
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
潤一 加藤
 
The Ring programming language version 1.9 book - Part 45 of 210
The Ring programming language version 1.9 book - Part 45 of 210The Ring programming language version 1.9 book - Part 45 of 210
The Ring programming language version 1.9 book - Part 45 of 210
Mahmoud Samir Fayed
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
InfluxData
 
From android/ java to swift (2)
From android/ java to swift (2)From android/ java to swift (2)
From android/ java to swift (2)
allanh0526
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + Kafka
Knoldus Inc.
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loop
Saša Tatar
 
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196
Mahmoud Samir Fayed
 
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
The Statistical and Applied Mathematical Sciences Institute
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
Steven Beeckman
 
The Ring programming language version 1.8 book - Part 42 of 202
The Ring programming language version 1.8 book - Part 42 of 202The Ring programming language version 1.8 book - Part 42 of 202
The Ring programming language version 1.8 book - Part 42 of 202
Mahmoud Samir Fayed
 
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple ActorsStrategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Faculty of Computer Science - Free University of Bozen-Bolzano
 

Similar to here is my code so far but I cant get it to run properly because I kee.pdf (20)

InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
 
Node.js - As a networking tool
Node.js - As a networking toolNode.js - As a networking tool
Node.js - As a networking tool
 
The Ring programming language version 1.2 book - Part 26 of 84
The Ring programming language version 1.2 book - Part 26 of 84The Ring programming language version 1.2 book - Part 26 of 84
The Ring programming language version 1.2 book - Part 26 of 84
 
alexnet.pdf
alexnet.pdfalexnet.pdf
alexnet.pdf
 
Swift Ready for Production?
Swift Ready for Production?Swift Ready for Production?
Swift Ready for Production?
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
 
Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
The Ring programming language version 1.5.1 book - Part 35 of 180
The Ring programming language version 1.5.1 book - Part 35 of 180The Ring programming language version 1.5.1 book - Part 35 of 180
The Ring programming language version 1.5.1 book - Part 35 of 180
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
 
The Ring programming language version 1.9 book - Part 45 of 210
The Ring programming language version 1.9 book - Part 45 of 210The Ring programming language version 1.9 book - Part 45 of 210
The Ring programming language version 1.9 book - Part 45 of 210
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
 
From android/ java to swift (2)
From android/ java to swift (2)From android/ java to swift (2)
From android/ java to swift (2)
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + Kafka
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loop
 
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196
 
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
 
The Ring programming language version 1.8 book - Part 42 of 202
The Ring programming language version 1.8 book - Part 42 of 202The Ring programming language version 1.8 book - Part 42 of 202
The Ring programming language version 1.8 book - Part 42 of 202
 
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple ActorsStrategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
 

More from trishulinoverseas1

Hi I need help with this problem thank you! Hi I need help with this p.pdf
Hi I need help with this problem thank you! Hi I need help with this p.pdfHi I need help with this problem thank you! Hi I need help with this p.pdf
Hi I need help with this problem thank you! Hi I need help with this p.pdf
trishulinoverseas1
 
hey guys do fill the t accounts out of it in the below screenshot att.pdf
hey guys  do fill the t accounts out of it in the below screenshot att.pdfhey guys  do fill the t accounts out of it in the below screenshot att.pdf
hey guys do fill the t accounts out of it in the below screenshot att.pdf
trishulinoverseas1
 
Hi Expert- could you please type the answers to see better )micro cour.pdf
Hi Expert- could you please type the answers to see better )micro cour.pdfHi Expert- could you please type the answers to see better )micro cour.pdf
Hi Expert- could you please type the answers to see better )micro cour.pdf
trishulinoverseas1
 
Hi Expert ! could you please type the answers to see better! microbio.pdf
Hi Expert !  could you please type the answers to see better! microbio.pdfHi Expert !  could you please type the answers to see better! microbio.pdf
Hi Expert ! could you please type the answers to see better! microbio.pdf
trishulinoverseas1
 
Hey- I am struggling with this question- please help Journal entrv wor.pdf
Hey- I am struggling with this question- please help Journal entrv wor.pdfHey- I am struggling with this question- please help Journal entrv wor.pdf
Hey- I am struggling with this question- please help Journal entrv wor.pdf
trishulinoverseas1
 
Hhiory and Fhoweal Labocatery Results Complete the diagram by draggin.pdf
Hhiory and Fhoweal Labocatery Results  Complete the diagram by draggin.pdfHhiory and Fhoweal Labocatery Results  Complete the diagram by draggin.pdf
Hhiory and Fhoweal Labocatery Results Complete the diagram by draggin.pdf
trishulinoverseas1
 
Here- for esample- HTTH represents the outcome that the first toss is.pdf
Here- for esample- HTTH represents the outcome that the first toss is.pdfHere- for esample- HTTH represents the outcome that the first toss is.pdf
Here- for esample- HTTH represents the outcome that the first toss is.pdf
trishulinoverseas1
 
Here are the errors associated with a particular forecast over the pas.pdf
Here are the errors associated with a particular forecast over the pas.pdfHere are the errors associated with a particular forecast over the pas.pdf
Here are the errors associated with a particular forecast over the pas.pdf
trishulinoverseas1
 
Here is an example of active- natural immunity- If you had chicken pox.pdf
Here is an example of active- natural immunity- If you had chicken pox.pdfHere is an example of active- natural immunity- If you had chicken pox.pdf
Here is an example of active- natural immunity- If you had chicken pox.pdf
trishulinoverseas1
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
trishulinoverseas1
 
Here is a chart of the Nasdaq Composite- the world's main technology i.pdf
Here is a chart of the Nasdaq Composite- the world's main technology i.pdfHere is a chart of the Nasdaq Composite- the world's main technology i.pdf
Here is a chart of the Nasdaq Composite- the world's main technology i.pdf
trishulinoverseas1
 
Here are the alphas and the betas for Company A and Company B- Alpha i.pdf
Here are the alphas and the betas for Company A and Company B- Alpha i.pdfHere are the alphas and the betas for Company A and Company B- Alpha i.pdf
Here are the alphas and the betas for Company A and Company B- Alpha i.pdf
trishulinoverseas1
 
Homework for Day 1 Design and carry out a simulation to answer the fol.pdf
Homework for Day 1 Design and carry out a simulation to answer the fol.pdfHomework for Day 1 Design and carry out a simulation to answer the fol.pdf
Homework for Day 1 Design and carry out a simulation to answer the fol.pdf
trishulinoverseas1
 
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdf
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdfHot spots are used as a proof of P2T- the continent sliding over a sta.pdf
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdf
trishulinoverseas1
 
Housing DataThe accompanying frequency distribution represents the own.pdf
Housing DataThe accompanying frequency distribution represents the own.pdfHousing DataThe accompanying frequency distribution represents the own.pdf
Housing DataThe accompanying frequency distribution represents the own.pdf
trishulinoverseas1
 
hotel BLU Vancouver what steps and progress has been achieved 6points.pdf
hotel BLU Vancouver what steps and progress has been achieved 6points.pdfhotel BLU Vancouver what steps and progress has been achieved 6points.pdf
hotel BLU Vancouver what steps and progress has been achieved 6points.pdf
trishulinoverseas1
 
Herb and Alice are married and file a joint return- Herb is 74 years o.pdf
Herb and Alice are married and file a joint return- Herb is 74 years o.pdfHerb and Alice are married and file a joint return- Herb is 74 years o.pdf
Herb and Alice are married and file a joint return- Herb is 74 years o.pdf
trishulinoverseas1
 
Homework E-1- Write a class for a School- Use a School object in the S.pdf
Homework E-1- Write a class for a School- Use a School object in the S.pdfHomework E-1- Write a class for a School- Use a School object in the S.pdf
Homework E-1- Write a class for a School- Use a School object in the S.pdf
trishulinoverseas1
 
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdfHomework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
trishulinoverseas1
 
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdfHome Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
trishulinoverseas1
 

More from trishulinoverseas1 (20)

Hi I need help with this problem thank you! Hi I need help with this p.pdf
Hi I need help with this problem thank you! Hi I need help with this p.pdfHi I need help with this problem thank you! Hi I need help with this p.pdf
Hi I need help with this problem thank you! Hi I need help with this p.pdf
 
hey guys do fill the t accounts out of it in the below screenshot att.pdf
hey guys  do fill the t accounts out of it in the below screenshot att.pdfhey guys  do fill the t accounts out of it in the below screenshot att.pdf
hey guys do fill the t accounts out of it in the below screenshot att.pdf
 
Hi Expert- could you please type the answers to see better )micro cour.pdf
Hi Expert- could you please type the answers to see better )micro cour.pdfHi Expert- could you please type the answers to see better )micro cour.pdf
Hi Expert- could you please type the answers to see better )micro cour.pdf
 
Hi Expert ! could you please type the answers to see better! microbio.pdf
Hi Expert !  could you please type the answers to see better! microbio.pdfHi Expert !  could you please type the answers to see better! microbio.pdf
Hi Expert ! could you please type the answers to see better! microbio.pdf
 
Hey- I am struggling with this question- please help Journal entrv wor.pdf
Hey- I am struggling with this question- please help Journal entrv wor.pdfHey- I am struggling with this question- please help Journal entrv wor.pdf
Hey- I am struggling with this question- please help Journal entrv wor.pdf
 
Hhiory and Fhoweal Labocatery Results Complete the diagram by draggin.pdf
Hhiory and Fhoweal Labocatery Results  Complete the diagram by draggin.pdfHhiory and Fhoweal Labocatery Results  Complete the diagram by draggin.pdf
Hhiory and Fhoweal Labocatery Results Complete the diagram by draggin.pdf
 
Here- for esample- HTTH represents the outcome that the first toss is.pdf
Here- for esample- HTTH represents the outcome that the first toss is.pdfHere- for esample- HTTH represents the outcome that the first toss is.pdf
Here- for esample- HTTH represents the outcome that the first toss is.pdf
 
Here are the errors associated with a particular forecast over the pas.pdf
Here are the errors associated with a particular forecast over the pas.pdfHere are the errors associated with a particular forecast over the pas.pdf
Here are the errors associated with a particular forecast over the pas.pdf
 
Here is an example of active- natural immunity- If you had chicken pox.pdf
Here is an example of active- natural immunity- If you had chicken pox.pdfHere is an example of active- natural immunity- If you had chicken pox.pdf
Here is an example of active- natural immunity- If you had chicken pox.pdf
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
 
Here is a chart of the Nasdaq Composite- the world's main technology i.pdf
Here is a chart of the Nasdaq Composite- the world's main technology i.pdfHere is a chart of the Nasdaq Composite- the world's main technology i.pdf
Here is a chart of the Nasdaq Composite- the world's main technology i.pdf
 
Here are the alphas and the betas for Company A and Company B- Alpha i.pdf
Here are the alphas and the betas for Company A and Company B- Alpha i.pdfHere are the alphas and the betas for Company A and Company B- Alpha i.pdf
Here are the alphas and the betas for Company A and Company B- Alpha i.pdf
 
Homework for Day 1 Design and carry out a simulation to answer the fol.pdf
Homework for Day 1 Design and carry out a simulation to answer the fol.pdfHomework for Day 1 Design and carry out a simulation to answer the fol.pdf
Homework for Day 1 Design and carry out a simulation to answer the fol.pdf
 
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdf
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdfHot spots are used as a proof of P2T- the continent sliding over a sta.pdf
Hot spots are used as a proof of P2T- the continent sliding over a sta.pdf
 
Housing DataThe accompanying frequency distribution represents the own.pdf
Housing DataThe accompanying frequency distribution represents the own.pdfHousing DataThe accompanying frequency distribution represents the own.pdf
Housing DataThe accompanying frequency distribution represents the own.pdf
 
hotel BLU Vancouver what steps and progress has been achieved 6points.pdf
hotel BLU Vancouver what steps and progress has been achieved 6points.pdfhotel BLU Vancouver what steps and progress has been achieved 6points.pdf
hotel BLU Vancouver what steps and progress has been achieved 6points.pdf
 
Herb and Alice are married and file a joint return- Herb is 74 years o.pdf
Herb and Alice are married and file a joint return- Herb is 74 years o.pdfHerb and Alice are married and file a joint return- Herb is 74 years o.pdf
Herb and Alice are married and file a joint return- Herb is 74 years o.pdf
 
Homework E-1- Write a class for a School- Use a School object in the S.pdf
Homework E-1- Write a class for a School- Use a School object in the S.pdfHomework E-1- Write a class for a School- Use a School object in the S.pdf
Homework E-1- Write a class for a School- Use a School object in the S.pdf
 
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdfHomework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
Homework - Unanswered - Due Today- 4-45 PM assume 100 units of energy.pdf
 
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdfHome Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
Home Insert Page Layout Formulas Data Review View HelpL34- 7 In cell M.pdf
 

Recently uploaded

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 

Recently uploaded (20)

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 

here is my code so far but I cant get it to run properly because I kee.pdf

  • 1. here is my code so far but I cant get it to run properly because I keep getting an error code saying 75:14 Kotlin: Expecting ')' import java.io.File class Weather(val date: String, val precipitation: Float, val snowfall: Float, val snowDepth: Float, val maxTemperature: Float, val minTemperature: Float, val avgTemperature: Float, val heatingDegreeDays: Float, val coolingDegreeDays: Float, val sunrise: String, val sunset: String, val lengthOfDay: String) fun readData(): Map { val weatherDB = mutableMapOf () val lines = File("weather.db").readLines().drop(1) for (line in lines) { val row = line.split(",") val date = row[0] val precipitation = row[1].toFloat() val snowfall = row[2].toFloat() val snowDepth = row[3].toFloat() val maxTemperature = row[4].toFloat() val minTemperature = row[5].toFloat() val avgTemperature = row[6].toFloat() val heatingDegreeDays = row[7].toFloat() val coolingDegreeDays = row[8].toFloat() val sunrise = row[9] val sunset = row[10] val lengthOfDay = row[11] val key = getKey(date) weatherDB[key] = Weather(date, precipitation, snowfall, snowDepth, maxTemperature, minTemperature, avgTemperature, heatingDegreeDays, coolingDegreeDays, sunrise, sunset, lengthOfDay) } return weatherDB } fun getKey(date: String): String { val (month, day) = date.split("/") return "${month.padStart(2, '0')}/${day.padStart(2, '0')}" } fun printHeader() { println("%-10s%-15s%-10s%-10s%-10s%- 10s%-10s%-10s%-10s%-10s%-10s%-15s".format( "Date", "Precipitation", "Snowfall", "Snow Depth", "Max Temp.", "Min Temp.", "Avg Temp.", "HDD", "CDD", "Sunrise", "Sunset", "Length of Day")) } fun printAllRecords(weatherDB: Map ) { printHeader() for ((_, weather) in weatherDB) { println("%-10s%-15.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%-10.2f%- 10s%-10s%-15s".format( weather.date, weather.precipitation, weather.snowfall, weather.snowDepth, weather.maxTemperature, weather.minTemperature, weather.avgTemperature, weather.heatingDegreeDays, weather.coolingDegreeDays, weather.sunrise, weather.sunset, weather.lengthOfDay)) } } fun printRecordsFromSingleMonth(weatherDB: Map ) { printHeader() print("Enter month (MM): ") val month = readLine()!!.padStart(2, '0') for ((key, weather) in weatherDB) { if (key.startsWith(month)) { println(message = "%-10s%-15.2f%-10.2f%-10.2f%-10.2f%-10.2f%- 10.2f%-10.2f%-10.2f%-10s%-10s%-15s".format( weather.date, weather.precipitation, weather.snowfall, weather.snowDepth, weather.maxTemperature, weather.minTemperature, weather.avgTemperature, weather ) }