Menu

Fashion Trendy
  • Drop Down

    • Abstract
    • Model
    • Techo
    • Options
  • Photography Pictures Product

    Drop Menu

    • Crystal
    • Digital
    • Graphs
    • Settings
  • Menu

    THE HONEST VISIONS

    Header Background

    Header Background
    Header Background Image. Ideal width 1600px with.
    • Home
    • Digital Art
      • Pics
        • SEO 1
        • SEO 2
      • CSS
        • CSS 1
        • CSS 2
        • CSS 3
        • CSS 4
        • CSS 5
      • Jquery
        • Jquery 1
        • Jquery 2
    • Fashion
      • Product 1
        • Sub Item
        • Sub Item
      • Product 2
        • Sub Item
        • Sub Item
    • Photography
    • Design
    Go
    Home » TCS PA » TCS python Proctored assessment 28th December solution

    TCS python Proctored assessment 28th December solution



    Q1.Create a class called apartment with attributes flat number,owner name,

    electicitybillamount. Create another class apartment_demo with 

    def init(self): pass to create a method getSecondMinBill that takes the list of 

    objects and gives the second minimum electricity bill as output.


    Sample Input:
    3
    1000 
    Hari
    5000 
    1001
    Hena 
    5002 
    1002
    Harsha
    5001

    Sample Output:
    5001

    Solution:


    class apartment:
    def __init__(self,flat_number,owner_name,electricity_bill_ammount):
    self.flat_number=flat_number
    self.owner_name=owner_name
    self.electricity_bill_ammount=electricity_bill_ammount

    class apartment_demo:
    def __init__(self):
    pass
    def getSecondMinBill(self,objList):
    electricityList=[]
    for i in objList:
    electricityList.append(i.electricity_bill_ammount)
    electricityList.sort()
    for j in electricityList:
    return print(electricityList[1])


    if __name__=='__main__':
    count=int(input())
    objList=[]
    for i in range (count):
    flat_number=int(input())
    owner_name=input()
    electricity_bill_ammount=int(input())
    objList.append(apartment(flat_number,owner_name,electricity_bill_ammount))
    output=apartment_demo().getSecondMinBill(objList)

    Q2. Create a class Bill with attributes mobile number and payment bill. Create another class mobile with attributes serviceprovider, mobilenumber, dataused, 

    payment method. Service provider maybe airtel or jio.Data used is integer values  in Gigabytes(GB). Payment method maybe paytm,gpay,amazon and soon. Create a method calculatebill that takes the list of objects and calculates the bill and 

    returns the list of objects of class bill with mobile number and paymentbill. 


    The payment is calculated as follows: 

    1. If the service provider is airtel, the bill is Rs.11 for every 1GB used and if it is jio, the bill is Rs.10 for every 1GB used. 

    2.

    If the payment method is paytm there is a cash back of 10% of the total bill for airtel users only.The bill is calculated and roundedoff after deducing the cashback value. 

     

    Sample Input: 


    3 
    airtel 
    123
    16
    paytm
    airtel
    456
    10
    amazon
    jio
    789
    10
    paytm

    Sample Output:

    (123,158)
    (456,110)
    (789,100)

    Solution:
    class Bill:
    def __init__(self,mobileNumber,paymentBill):
    self.mobileNumber=mobileNumber
    self.paymentBill=paymentBill

    class mobile:
    def __init__(self,serviceProvider,mobileNumber,dataUsed,paymentMethod):
    self.serviceProvider=serviceProvider
    self.mobileNumber=mobileNumber
    self.dataUsed=dataUsed
    self.paymentMethod=paymentMethod

    def calculateBill(self,olist):
    blist=[]
    for i in olist:
    if i.serviceProvider=="airtel":
    bill=11*i.dataUsed
    totalBill=bill
    if i.paymentMethod=="paytm":
    totalBill=bill-(0.1*bill)

    elif i.serviceProvider=="jio":
    totalBill=10*i.dataUsed
    blist.append(mobile(i.mobileNumber,int(totalBill)))
    return blist

    if __name__=='__main__':
    count=int(input())
    olist=[]
    for i in range (count):
    serviceProvider=input()
    mobileNumber=int(input())
    dataUsed=int(input())
    paymentMethod=input()
    olist.append(Bill(serviceProvider,mobileNumber,dataUsed,paymentMethod))
    output=mobile("",0,0,"").calculateBill(olist)
    for j in output:
    print(j.mobileNumber,j.paymentBill)


    theinfinitevisions
    Add Comment
    TCS PA
    Friday, August 14, 2020

    facebook

    twitter

    google+

    fb share

    About theinfinitevisions

    Related Posts
    < Previous Post Next Post >

    Powered by Blogger.

    Comments

    3-comments

    Comments

    FOLLOW ME

    LATEST

    3-latest-65px

    Facebook


    Top Links Menu

    • 9096307522
    • adarsh8794@gmail.com

    Report Abuse

    Top Links Menu

    • Instagram
    • YouTube
    • Facebook
    • Twitter

    Why did the Chinese soldiers cry before going to the Indo-China border

    Why did the Chinese soldiers cry before going to the Indo-China border? Read on Seeing the power of Indian troops on the Indo-China border, ...

    Menu based on Icons

    • Home
    • catagories
    • Item
    • Item
    • Contact us

    Total Pageviews

    Sections


    Campus

    Courses

    Testimonials

    Blog Archive

    • ▼  2020 (28)
      • ►  September (10)
      • ▼  August (18)
        • All About Former President of India Pranab Mukherjee
        • All about Chadwik Aaron Boseman (1976-2020)
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing websites for watching Hindi movies onlin...
        • 10 amazing facts about Suashant singh rajput you d...
        • 10 Amazing facts about Indian politics you definit...
        • Ganesh Chaturthi one of the greatest event celebr...
        • TCS python Proctored Assessment 10th february solu...
        • TCS python Proctored Assessment 25th January solution
        • 10 amazing websites you definitely don’t know abou...
        • 10 Amazing websites you definitely don't know abo...
        • TCS python Proctored Assessment 15th January sulution
        • 10 Superstitions In India and There scientific rea...
        • Celebrating 74th Independence Day of INDIA...
        • TCS python Proctored assessment 28th December solu...
        • TCS python Proctored Assessment 17th December solu...

    You Tube Videos

    Campus

    4-tag:Campus-500px-mosaic

    Ad Home

    About

    This just a demo text widget, you can use it to create an about text, for example.

    Testimonials

    3-tag:Testimonials-250px-testimonial

    Main Menu

    • About
    • Home
    • Catagories
    • -Item
    • -Item
    • -Superstitions
    • -Social
    • -Movies
    • -Facts
    • -Amazing websites

    Random Posts

    Recent Posts

    Header Ads

    Popular Posts

    • TCS python Proctored Assessment 25th January solution
      Coding Question 1- Create a function check_prime() that takes a number as an argument and returns  1 if the number is prime ,  0 if it comp...
    • TCS python Proctored Assessment 10th february solution
      Q1- Take acc number, holder name, balance as input. Add the deposit amount as input. Request a withdrawal. If balance after withdrawal is mo...
    • Why did the Chinese soldiers cry before going to the Indo-China border
      Why did the Chinese soldiers cry before going to the Indo-China border? Read on Seeing the power of Indian troops on the Indo-China border, ...
    • TCS python Proctored Assessment 17th December solution

    Logo

    Logo
    Logo Image. Ideal width 300px.

    Section Background

    Section Background
    Background image. Ideal width 1600px with.

    Section Background

    Section Background
    Background image. Ideal width 1600px with.

    Ads block

    Banner 728x90px

    Blogs

    Section Background

    Section Background

    ABOUT

    theinfinitevisions
    View my complete profile

    Contact us-desc:Feel free to contact us at anytime about our courses and tutorials.

    Name

    Email *

    Message *


    Categories

    actors actress adventure Amazing websites America Bangla Black panther Chadwick Boseman cinema Clothing comedy Congress crime cristopher nolan DC Death Defence Minister drama Facts Famous film filmcommunity filmmaker Finance Minister hollywood horror INC India Indira Gandhi instagram Marvel MCU minister Movies netflix politics Pranab Mukherjee president Rajiv Gandhi science fiction Social Soniya Gandhi Stan lee Superstitions TCS PA theatre TV Shows

    Follow Us

    Sponsor

    SEARCH

    FOLLOW ME

    Popular

    • TCS python Proctored Assessment 25th January solution
      Coding Question 1- Create a function check_prime() that takes a number as an argument and returns  1 if the number is prime ,  0 if it comp...
    • TCS python Proctored Assessment 10th february solution
      Q1- Take acc number, holder name, balance as input. Add the deposit amount as input. Request a withdrawal. If balance after withdrawal is mo...
    • Why did the Chinese soldiers cry before going to the Indo-China border
      Why did the Chinese soldiers cry before going to the Indo-China border? Read on Seeing the power of Indian troops on the Indo-China border, ...

    Social Share

    Weekly Posts

    • TCS python Proctored Assessment 25th January solution
      Coding Question 1- Create a function check_prime() that takes a number as an argument and returns  1 if the number is prime ,  0 if it comp...
    • TCS python Proctored Assessment 10th february solution
      Q1- Take acc number, holder name, balance as input. Add the deposit amount as input. Request a withdrawal. If balance after withdrawal is mo...
    • Why did the Chinese soldiers cry before going to the Indo-China border
      Why did the Chinese soldiers cry before going to the Indo-China border? Read on Seeing the power of Indian troops on the Indo-China border, ...

    Like us On Facebook

    Labels

    • actors (7)
    • actress (4)
    • adventure (7)
    • Amazing websites (3)
    • America (2)
    • Bangla (1)
    • Black panther (2)
    • Chadwick Boseman (1)
    • cinema (5)
    • Clothing (3)
    • comedy (5)
    • Congress (1)
    • crime (5)
    • cristopher nolan (5)
    • DC (5)
    • Death (2)
    • Defence Minister (1)
    • drama (5)
    • Facts (2)
    • Famous (3)
    • film (6)
    • filmcommunity (6)
    • filmmaker (6)
    • Finance Minister (1)
    • hollywood (5)
    • horror (4)
    • INC (1)
    • India (3)
    • Indira Gandhi (1)
    • instagram (4)
    • Marvel (6)
    • MCU (2)
    • minister (1)
    • Movies (3)
    • netflix (5)
    • politics (1)
    • Pranab Mukherjee (1)
    • president (1)
    • Rajiv Gandhi (1)
    • science fiction (5)
    • Social (6)
    • Soniya Gandhi (1)
    • Stan lee (2)
    • Superstitions (1)
    • TCS PA (7)
    • theatre (5)
    • TV Shows (2)

    Copyright THE HONEST VISIONS 2014 . Template Created by