SlideShare a Scribd company logo
(TCO 2) Although the following code compiles and runs, the programmer broke some major
readability rules. Describe at least three changes that would make it easier for other programmers
to read and understand the code.
class Program
{
static void Main() //main
{
int a;
int Floater = 10; // ints
for(int i = 0;i < Floater;i++) /* loop */{
a=function(i);
Console.WriteLine(a);
}
Console.Read(); //read
}
public static int function(int a) /*function*/ {
return (int)(Math.Pow((double)a,2.0));
}
}
(Points : 20)
Solution
using System;
namespace Application
{
class Program
{
public static int function(int a) /*function*/ {
return (int)(Math.Pow((double)a,2.0));
}
static void Main() //main
{
int a;
int Floater = 10; // ints
for(int i = 0;i < Floater;i++) /* loop */{
a=function(i);
Console.WriteLine(a);
}
Console.Read(); //read
}
}
}
Output:

More Related Content

Similar to (TCO 2) Although the following code compiles and runs- the programmer.docx

C Programming ppt for beginners . Introduction
C Programming ppt for beginners . IntroductionC Programming ppt for beginners . Introduction
C Programming ppt for beginners . Introduction
raghukatagall2
 
C structure
C structureC structure
C structure
ankush9927
 
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
Hadziq Fabroyir
 
Cpp
CppCpp
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
Ahammed Alamin
 
chapter-8-function-overloading.pdf
chapter-8-function-overloading.pdfchapter-8-function-overloading.pdf
chapter-8-function-overloading.pdf
study material
 
Xiicsmonth
XiicsmonthXiicsmonth
Xiicsmonth
rishikasahu1908
 
Activity 5
Activity 5Activity 5
Activity 5
Heidi Owens
 
Object oriented programming system with C++
Object oriented programming system with C++Object oriented programming system with C++
Object oriented programming system with C++
msharshitha03s
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
Mohamed Abdallah
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
Sunil OS
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
Gaurav Singh
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
Rumman Ansari
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
Nico Ludwig
 
embeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptxembeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptx
sangeetaSS
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
rohassanie
 
Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++
ppd1961
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
David Barreto
 
Python at Facebook
Python at FacebookPython at Facebook
Python at Facebook
Angelo Failla
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
Nikhil Pandit
 

Similar to (TCO 2) Although the following code compiles and runs- the programmer.docx (20)

C Programming ppt for beginners . Introduction
C Programming ppt for beginners . IntroductionC Programming ppt for beginners . Introduction
C Programming ppt for beginners . Introduction
 
C structure
C structureC structure
C structure
 
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
 
Cpp
CppCpp
Cpp
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
chapter-8-function-overloading.pdf
chapter-8-function-overloading.pdfchapter-8-function-overloading.pdf
chapter-8-function-overloading.pdf
 
Xiicsmonth
XiicsmonthXiicsmonth
Xiicsmonth
 
Activity 5
Activity 5Activity 5
Activity 5
 
Object oriented programming system with C++
Object oriented programming system with C++Object oriented programming system with C++
Object oriented programming system with C++
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
 
embeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptxembeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptx
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++Generalized Functors - Realizing Command Design Pattern in C++
Generalized Functors - Realizing Command Design Pattern in C++
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Python at Facebook
Python at FacebookPython at Facebook
Python at Facebook
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 

More from pjoseph6

-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
pjoseph6
 
(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx
pjoseph6
 
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
pjoseph6
 
- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx
pjoseph6
 
- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx
pjoseph6
 
(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx
pjoseph6
 
- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx
pjoseph6
 
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
pjoseph6
 
- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx
pjoseph6
 
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
pjoseph6
 

More from pjoseph6 (10)

-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
-- NaCIO- Bu4NHSO4 EtOAc (ethyl acetate) Benzophenone Benzhydrol Solut.docx
 
(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx(Multiple choice) Which one of the following statements is true- Expla.docx
(Multiple choice) Which one of the following statements is true- Expla.docx
 
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
(Internal controls for plant assets) Harris- CPA- has accepted an enga.docx
 
- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx- What is continuous linked settlement and how does it operate- - What.docx
- What is continuous linked settlement and how does it operate- - What.docx
 
- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx- What is a right-to-work state- What are the advantages or disadvanta.docx
- What is a right-to-work state- What are the advantages or disadvanta.docx
 
(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx(b) Ionization energy generally increases from left to right across th.docx
(b) Ionization energy generally increases from left to right across th.docx
 
- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx- How are corporate hierarchies related to the systems concept-Solutio.docx
- How are corporate hierarchies related to the systems concept-Solutio.docx
 
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
- Describe in one or two paragraphs what is Web (8-10 lines) Your desc.docx
 
- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx- Classify each of the following as a pure substance or a mixture- if.docx
- Classify each of the following as a pure substance or a mixture- if.docx
 
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
- Below are nominal GDP and GDP deflators for four years- Calculate re.docx
 

Recently uploaded

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 

Recently uploaded (20)

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 

(TCO 2) Although the following code compiles and runs- the programmer.docx

  • 1. (TCO 2) Although the following code compiles and runs, the programmer broke some major readability rules. Describe at least three changes that would make it easier for other programmers to read and understand the code. class Program { static void Main() //main { int a; int Floater = 10; // ints for(int i = 0;i < Floater;i++) /* loop */{ a=function(i); Console.WriteLine(a); } Console.Read(); //read } public static int function(int a) /*function*/ { return (int)(Math.Pow((double)a,2.0)); } } (Points : 20)
  • 2. Solution using System; namespace Application { class Program { public static int function(int a) /*function*/ { return (int)(Math.Pow((double)a,2.0)); } static void Main() //main { int a; int Floater = 10; // ints for(int i = 0;i < Floater;i++) /* loop */{ a=function(i); Console.WriteLine(a); } Console.Read(); //read