SlideShare a Scribd company logo
Computer System and Programming
Assignment # 2
Instructions:
1. This assignment is only for DE38-ME-Syndicate A.
2. The solution of the assignment should include the code and the output of the programme.
3. Assignment is to be submitted individually in the form of hard copy (printed form).
4. Copying from one another or the internet isn’t permitted. Both (or more) parties involved
in plagiarising will be awarded zero marks. Assignment in which the code has been copied
from the internet will also be awarded zero marks.
5. In case of any queries, feel free to contact me.
6. The submission deadline of the assignment is January 10th
, 2017 before 04:00 p.m.
Question 1:
A car sharing company needs a coder to come up with a solution to calculate the fares of each
and every ride. Your job is to write a function that can do so for the said company. The fare of
a ride depends on three things: how long the ride is, how much traffic there is and how many
rides a particular customer has taken with that company. The per kilometre rate is set by the
driver. After the first 10 kilometres, per kilometre rate is reduced by half. The traffic can be
high “h” or low “l”. The customer status can be Pro “P”, Average “A” or Newbie “N”. If the
traffic is high then the 25 percent of the total fare is added to the final total. If the traffic is low,
then 10 percent of the total fare is deducted from the final total. The pro customer gets 20
percent, the average user 15 percent and the newbie user gets 10 percent discount respectively.
Question 2:
Take an integer as an input from the user and write a functions that counts the number of the
different digits in it. The length of the integer can vary. For example, if a user enters 1233231
then the program should display the total number of 1 (i.e. 2), the total number of 2 (i.e. 2) and
the total number of 3 (i.e. 3).
Question 3:
A Ruth–Aaron pair is a pair of two consecutive integers for which the sums of
the distinct prime factors of each integer are equal. For example, we know that (714, 715) is a
valid Ruth-Aaron pair because the sum of the distinct prime factors of 714 (2,3,7 and 17) and
the sum of the distinct prime factors of 715 (5, 11, 13) is equal to 29.
You need to write a function that takes two numbers as an input and returns a value which
indicate whether the pair is a valid Ruth-Aaron pair or not. The function should also check the
first condition of being a Ruth-Aaron pair.

More Related Content

Similar to Assignment # 2 computer system and Programming EC-105

Assignment # 1 c++ computer system and Programming EC-105
Assignment # 1 c++  computer system and Programming EC-105Assignment # 1 c++  computer system and Programming EC-105
Assignment # 1 c++ computer system and Programming EC-105
NUST Stuff
 
Cs141 term project
Cs141 term projectCs141 term project
Cs141 term project
Fahadaio
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
pradesigali1
 
Smart Car Parking System Using FPGA and E-Application
Smart Car Parking System Using FPGA and E-ApplicationSmart Car Parking System Using FPGA and E-Application
Smart Car Parking System Using FPGA and E-Application
IRJET Journal
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh
 
INT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax CalculatorINT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax Calculator
Qazi Maaz Arshad
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
pradesigali1
 
1 University of Leeds School of Computing Proced.docx
1 University of Leeds       School of Computing Proced.docx1 University of Leeds       School of Computing Proced.docx
1 University of Leeds School of Computing Proced.docx
jeremylockett77
 
IRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
IRJET- Analysis and Prediction of Delay at Signalized Junctions in BangaloreIRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
IRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
IRJET Journal
 
IRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter ReadingIRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter Reading
IRJET Journal
 
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part III
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part IIIIntro To C++ - Class 04 - An Introduction To C++ Programming, Part III
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part III
Blue Elephant Consulting
 
AUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEMAUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEM
Journal For Research
 
Vehicle tracking system
Vehicle tracking systemVehicle tracking system
Vehicle tracking systemSujit9561
 
Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...
Sujit9561
 
C05222124
C05222124C05222124
C05222124
IOSR-JEN
 
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment ProblemIRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET Journal
 
IRJET- Improvising Reliability of Autonomous Car using Risk Detection
IRJET-  	  Improvising Reliability of Autonomous Car using Risk DetectionIRJET-  	  Improvising Reliability of Autonomous Car using Risk Detection
IRJET- Improvising Reliability of Autonomous Car using Risk Detection
IRJET Journal
 

Similar to Assignment # 2 computer system and Programming EC-105 (20)

Assignment # 1 c++ computer system and Programming EC-105
Assignment # 1 c++  computer system and Programming EC-105Assignment # 1 c++  computer system and Programming EC-105
Assignment # 1 c++ computer system and Programming EC-105
 
Cs141 term project
Cs141 term projectCs141 term project
Cs141 term project
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
 
Smart Car Parking System Using FPGA and E-Application
Smart Car Parking System Using FPGA and E-ApplicationSmart Car Parking System Using FPGA and E-Application
Smart Car Parking System Using FPGA and E-Application
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
INT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax CalculatorINT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax Calculator
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 
1 University of Leeds School of Computing Proced.docx
1 University of Leeds       School of Computing Proced.docx1 University of Leeds       School of Computing Proced.docx
1 University of Leeds School of Computing Proced.docx
 
IRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
IRJET- Analysis and Prediction of Delay at Signalized Junctions in BangaloreIRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
IRJET- Analysis and Prediction of Delay at Signalized Junctions in Bangalore
 
IRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter ReadingIRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter Reading
 
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part III
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part IIIIntro To C++ - Class 04 - An Introduction To C++ Programming, Part III
Intro To C++ - Class 04 - An Introduction To C++ Programming, Part III
 
AUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEMAUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEM
 
Vehicle tracking system
Vehicle tracking systemVehicle tracking system
Vehicle tracking system
 
Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...
 
ijca_publication
ijca_publicationijca_publication
ijca_publication
 
C05222124
C05222124C05222124
C05222124
 
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment ProblemIRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
 
The problem statement
The problem statementThe problem statement
The problem statement
 
IRJET- Improvising Reliability of Autonomous Car using Risk Detection
IRJET-  	  Improvising Reliability of Autonomous Car using Risk DetectionIRJET-  	  Improvising Reliability of Autonomous Car using Risk Detection
IRJET- Improvising Reliability of Autonomous Car using Risk Detection
 

More from NUST Stuff

Me211 1
Me211 1Me211 1
Me211 1
NUST Stuff
 
Lab LCA 1 7
Lab LCA 1 7Lab LCA 1 7
Lab LCA 1 7
NUST Stuff
 
Me211 4
Me211 4Me211 4
Me211 4
NUST Stuff
 
Me211 3
Me211 3Me211 3
Me211 3
NUST Stuff
 
Drag force on a sphere in yield stress fluid
Drag force on a sphere in yield stress fluidDrag force on a sphere in yield stress fluid
Drag force on a sphere in yield stress fluid
NUST Stuff
 
Nums entry test 2017 paper
Nums entry test 2017 paperNums entry test 2017 paper
Nums entry test 2017 paper
NUST Stuff
 
Nums entry-test-new-syllabus-mbbsc-bds
Nums entry-test-new-syllabus-mbbsc-bdsNums entry-test-new-syllabus-mbbsc-bds
Nums entry-test-new-syllabus-mbbsc-bds
NUST Stuff
 
MCAT Full length paper 8-student_copy_
MCAT Full length paper  8-student_copy_MCAT Full length paper  8-student_copy_
MCAT Full length paper 8-student_copy_
NUST Stuff
 
MCAT Full length paper 7-student_copy_
MCAT Full length paper 7-student_copy_MCAT Full length paper 7-student_copy_
MCAT Full length paper 7-student_copy_
NUST Stuff
 
MCAT Full length paper 6-student_copy_
MCAT Full length paper  6-student_copy_MCAT Full length paper  6-student_copy_
MCAT Full length paper 6-student_copy_
NUST Stuff
 
MCAT Full length paper 5-student_copy_
MCAT Full length paper 5-student_copy_MCAT Full length paper 5-student_copy_
MCAT Full length paper 5-student_copy_
NUST Stuff
 
Mcat (original paper 2014)
Mcat (original paper 2014)Mcat (original paper 2014)
Mcat (original paper 2014)
NUST Stuff
 
MCAT Full length paper 4-student_copy
MCAT Full length paper  4-student_copyMCAT Full length paper  4-student_copy
MCAT Full length paper 4-student_copy
NUST Stuff
 
mcat (original paper 2013)
mcat (original paper 2013)mcat (original paper 2013)
mcat (original paper 2013)
NUST Stuff
 
mcat (original paper 2012)
mcat (original paper 2012)mcat (original paper 2012)
mcat (original paper 2012)
NUST Stuff
 
MCAT Full length paper 3 final
MCAT Full length paper 3 finalMCAT Full length paper 3 final
MCAT Full length paper 3 final
NUST Stuff
 
MCAT (original paper 2011)
MCAT (original paper 2011)MCAT (original paper 2011)
MCAT (original paper 2011)
NUST Stuff
 
mcat (original paper 2010)
 mcat (original paper 2010) mcat (original paper 2010)
mcat (original paper 2010)
NUST Stuff
 
MCAT Full length paper 1 (student copy)
MCAT Full length paper 1 (student copy)MCAT Full length paper 1 (student copy)
MCAT Full length paper 1 (student copy)
NUST Stuff
 

More from NUST Stuff (20)

Me211 1
Me211 1Me211 1
Me211 1
 
Lab LCA 1 7
Lab LCA 1 7Lab LCA 1 7
Lab LCA 1 7
 
Me211 2
Me211 2Me211 2
Me211 2
 
Me211 4
Me211 4Me211 4
Me211 4
 
Me211 3
Me211 3Me211 3
Me211 3
 
Drag force on a sphere in yield stress fluid
Drag force on a sphere in yield stress fluidDrag force on a sphere in yield stress fluid
Drag force on a sphere in yield stress fluid
 
Nums entry test 2017 paper
Nums entry test 2017 paperNums entry test 2017 paper
Nums entry test 2017 paper
 
Nums entry-test-new-syllabus-mbbsc-bds
Nums entry-test-new-syllabus-mbbsc-bdsNums entry-test-new-syllabus-mbbsc-bds
Nums entry-test-new-syllabus-mbbsc-bds
 
MCAT Full length paper 8-student_copy_
MCAT Full length paper  8-student_copy_MCAT Full length paper  8-student_copy_
MCAT Full length paper 8-student_copy_
 
MCAT Full length paper 7-student_copy_
MCAT Full length paper 7-student_copy_MCAT Full length paper 7-student_copy_
MCAT Full length paper 7-student_copy_
 
MCAT Full length paper 6-student_copy_
MCAT Full length paper  6-student_copy_MCAT Full length paper  6-student_copy_
MCAT Full length paper 6-student_copy_
 
MCAT Full length paper 5-student_copy_
MCAT Full length paper 5-student_copy_MCAT Full length paper 5-student_copy_
MCAT Full length paper 5-student_copy_
 
Mcat (original paper 2014)
Mcat (original paper 2014)Mcat (original paper 2014)
Mcat (original paper 2014)
 
MCAT Full length paper 4-student_copy
MCAT Full length paper  4-student_copyMCAT Full length paper  4-student_copy
MCAT Full length paper 4-student_copy
 
mcat (original paper 2013)
mcat (original paper 2013)mcat (original paper 2013)
mcat (original paper 2013)
 
mcat (original paper 2012)
mcat (original paper 2012)mcat (original paper 2012)
mcat (original paper 2012)
 
MCAT Full length paper 3 final
MCAT Full length paper 3 finalMCAT Full length paper 3 final
MCAT Full length paper 3 final
 
MCAT (original paper 2011)
MCAT (original paper 2011)MCAT (original paper 2011)
MCAT (original paper 2011)
 
mcat (original paper 2010)
 mcat (original paper 2010) mcat (original paper 2010)
mcat (original paper 2010)
 
MCAT Full length paper 1 (student copy)
MCAT Full length paper 1 (student copy)MCAT Full length paper 1 (student copy)
MCAT Full length paper 1 (student copy)
 

Recently uploaded

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
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
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
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
 
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 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
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
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
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
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
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 

Recently uploaded (20)

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
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
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
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
 
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 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
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
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
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 

Assignment # 2 computer system and Programming EC-105

  • 1. Computer System and Programming Assignment # 2 Instructions: 1. This assignment is only for DE38-ME-Syndicate A. 2. The solution of the assignment should include the code and the output of the programme. 3. Assignment is to be submitted individually in the form of hard copy (printed form). 4. Copying from one another or the internet isn’t permitted. Both (or more) parties involved in plagiarising will be awarded zero marks. Assignment in which the code has been copied from the internet will also be awarded zero marks. 5. In case of any queries, feel free to contact me. 6. The submission deadline of the assignment is January 10th , 2017 before 04:00 p.m. Question 1: A car sharing company needs a coder to come up with a solution to calculate the fares of each and every ride. Your job is to write a function that can do so for the said company. The fare of a ride depends on three things: how long the ride is, how much traffic there is and how many rides a particular customer has taken with that company. The per kilometre rate is set by the driver. After the first 10 kilometres, per kilometre rate is reduced by half. The traffic can be high “h” or low “l”. The customer status can be Pro “P”, Average “A” or Newbie “N”. If the traffic is high then the 25 percent of the total fare is added to the final total. If the traffic is low, then 10 percent of the total fare is deducted from the final total. The pro customer gets 20 percent, the average user 15 percent and the newbie user gets 10 percent discount respectively. Question 2: Take an integer as an input from the user and write a functions that counts the number of the different digits in it. The length of the integer can vary. For example, if a user enters 1233231 then the program should display the total number of 1 (i.e. 2), the total number of 2 (i.e. 2) and the total number of 3 (i.e. 3). Question 3: A Ruth–Aaron pair is a pair of two consecutive integers for which the sums of the distinct prime factors of each integer are equal. For example, we know that (714, 715) is a valid Ruth-Aaron pair because the sum of the distinct prime factors of 714 (2,3,7 and 17) and the sum of the distinct prime factors of 715 (5, 11, 13) is equal to 29. You need to write a function that takes two numbers as an input and returns a value which indicate whether the pair is a valid Ruth-Aaron pair or not. The function should also check the first condition of being a Ruth-Aaron pair.