1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
I am Lyosha [343]
3 years ago
8

Implement the Tollable interface. It provides one method, pay, that accepts an int (how many dollars to pay), and returns an int

(how much is paid).
Computers and Technology
1 answer:
AVprozaik [17]3 years ago
8 0

Answer:

Answered below.

Explanation:

\**This is written in the Kotlin programming language.**/

interface Tollable{

fun pay(payInDollars: Int) : Int

}

\**Interfaces are used to declare properties and methods that are common to different classes. As a result different classes can extend one interface.

The properties and methods in an interface are not always initialized. Classes extending from the interface are responsible for initializing these properties and methods. In Kotlin, a class can extend from more than one interface.**/

You might be interested in
How do you take a picture on this app
damaskus [11]
The paper clip.

Hope this helped.

Can i have brainliest?
8 0
3 years ago
How do you represent a 3D object with unusual curves in 2D space? CAN SOMEONE HELP PLEASE
levacccp [35]
You have to draw the extra lines out
7 0
3 years ago
Program:
Mkey [24]

Answer:

See explaination

Explanation:

#method to print menu & handle user choice

def print_menu(input_str):

#printing menu

print('MENU')

print('c - Number of non-whitespace characters')

print('w - Number of words')

print('f - Fix capitalization')

print('r - Replace punctuation')

print('s - Shorten spaces')

print('q - Quit\n')

#getting choice

choice=input('Choose an option: ').lower()

#identifying choice

if choice=='c':

#displaying number of non white space chars in input_str

print('Number of non-whitespace characters:',get_num_of_non_WS_characters(input_str))

elif choice=='w':

#displaying number of words in input_str

print('Number of words:',get_num_of_words(input_str))

elif choice=='f':

#fixing capitalization and getting updated string and count of values capitalized

input_str,count=fix_capilization(input_str)

#displaying results

print('Number of letters capitalized:',count)

print('Edited text:',input_str)

elif choice=='r':

#replacing punctuation, displaying updated text

input_str=replace_punctuation(input_str)

print('Edited text:', input_str)

elif choice=='s':

#shortening spaces and displaying updated text

input_str = shorten_space(input_str)

print('Edited text:', input_str)

#returning choice and input_str

return choice,input_str

#returns the number of non white space chars in input_str

def get_num_of_non_WS_characters(input_str):

count=0

#looping through each character in input_str

for i in input_str:

if not i.isspace():

#i is not a space

count+=1

return count

#returns the number of words in input_str

def get_num_of_words(input_str):

#splitting words into list of tokens by space

words=input_str.split(' ')

count=0

#counting all non empty strings in words list

for i in words:

if len(i)>0:

count+=1

return count

#method to fix capitalization and return updated string and count of letters updated

def fix_capilization(input_str):

count=0

beginning=True #starting letter should be capitalized

result=''

for i in input_str:

if beginning and i.isalpha():

#start of a sentence and i is alphabetic

if i.islower():

#converting i to upper case, incrementing count

i=i.upper()

count+=1

result+=i

#not start of a sentence

beginning=False

elif i in '?.!':

#i is either ? or . or !, next letter should be capitalized

beginning=True

result+=i

else:

#any other character

result+=i

return result,count

#method to replace exclamation and semicolons with period and comma respectively

def replace_punctuation(input_str,exclamationCount =0,semicolonCount=0):

result=''

for i in input_str:

if i=='!':

i='.'

exclamationCount+=1

elif i==';':

i=','

semicolonCount+=1

result+=i

print('Punctuation replaced')

#displaying replaced values counts

print('exclamationCount:',exclamationCount)

print('semicolonCount:',semicolonCount)

return result

#removes all double or more spaces in input_str

def shorten_space(input_str):

input_str=input_str.strip()

result=''

prev=None

for i in input_str:

if prev==None:

result+=i

elif i==' ':

if prev != ' ':

result+=i

else:

result+=i

prev=i

return result

if __name__ == '__main__':

#getting input, printing it

input_str=input('Enter a sample text:\n')

print('\nYou entered:',input_str)

choice=' '

#looping until choice becomes q

while choice!='q':

choice,input_str=print_menu(input_str)

7 0
3 years ago
What is IBM compadibles
mixer [17]

Answer:

IBM PC compatible computers are computers similar to the original IBM PC, XT, and AT that are able to use the same software and expansion cards. Such computers were referred to as PC clones, or IBM clones

8 0
3 years ago
Write a SELECT statement that returns the same result set as this SELECT statement. Substitute a subquery in a WHERE clause for
AleksAgata [21]

Answer:

SELECT DISTINCT VendorName FROM Vendors

WHERE VendorName= ANY (SELECT VendorName FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID) ORDER BY VendorName;

Explanation:

All bold faced words are sql keywords for different purposes. The subquery return the all values which matches the join condition  and main query will choose only distinct values and make them in order of VendorName.

There many other queries also return the same result as returned by given query.

8 0
2 years ago
Other questions:
  • Nathan wants to create multiple worksheet containing common formatting styles for his team members. Which file extension helps h
    5·1 answer
  • Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
    10·1 answer
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • A database has a built-in capability to create, process and administer itself.
    14·1 answer
  • Which formulas would work to combine cells with first, middle, and last names from columns A through C and row 2 into a new cell
    14·2 answers
  • There is usually a positive side and a negative side to each technology improvement. Select a technology you use every day and c
    5·1 answer
  • John has subscribed to a cloud-based service to synchronize data between his smartphone, tablet, and PC. Before allowing the dat
    10·1 answer
  • Integral 3t+ 1 / (t + 1)^2​
    9·1 answer
  • Laptops are used for accessing the internet. Name two advantages and two disadvantages for using a laptop rather than a smartpho
    5·2 answers
  • Candy Kane Cosmetics (CKC) produces Leslie Perfume, which requires chemicals and labor. Two production processes are available:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!