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
Tcecarenko [31]
3 years ago
11

Given the variables costOfBusRental and maxBusRiders of type int , write an expression corresponding to the cost per rider (assu

ming the bus is full). (Do not worry about any fractional part of the expression-- let integer arithmetic, with truncation, act here.)
Computers and Technology
1 answer:
Liono4ka [1.6K]3 years ago
7 0

Answer:

       int costOfBusRental;

       int maxBusRiders;

       int costPerRider;

       costPerRider = costOfBusRental/maxBusRiders;

Explanation:

The costPerRider is the total cost of renting the bus (costofBusRental) divided by all the bus users (maxBusRiders). So we declare the three variables to be of type int as required by the question.

You might be interested in
A program runs from start to finish, producing unexpected results, though no error message is received. What most likely occurre
adelina 88 [10]

Answer:

The answer is most likely B

Explanation:

If it is a logic error, then the computer thinks it is doing the correct task.

8 0
3 years ago
Modify the sentence-generator program of Case Study so that it inputs its vocabulary from a set of text files at startup. The fi
Snezhnost [94]

Answer:

Go to explaination for the program code.

Explanation:

Before running the program you need to have these files created like below in your unix box.

Unix Terminal> cat nouns.txt

BOY

GIRL

BAT

BALL

Unix Terminal> cat articles.txt

A

THE

Unix Terminal> cat verbs.txt

HIT

SAW

LIKED

Unix Terminal> cat prepositions.txt

WITH

BY

Unix Terminal>

Code:

#!/usr/local/bin/python3

import random

def getWords(filename):

fp = open(filename)

temp_list = list()

for each_line in fp:

each_line = each_line.strip()

temp_list.append(each_line)

words = tuple(temp_list)

fp.close()

return words

articles = getWords('articles.txt')

nouns = getWords('nouns.txt')

verbs = getWords('verbs.txt')

prepositions = getWords('prepositions.txt')

def sentence():

return nounPhrase() + " " + verbPhrase()

def nounPhrase():

return random.choice(articles) + " " + random.choice(nouns)

def verbPhrase():

return random.choice(verbs) + " " + nounPhrase() + " " + prepositionalPhrase()

def prepositionalPhrase():

return random.choice(prepositions) + " " + nounPhrase()

def main():

number = int(input('Enter number of sentences: '))

for count in range(number):

print(sentence())

if __name__=='__main__':

main()

kindly check attachment for code output and onscreen code.

6 0
3 years ago
The _____ search algorithm searches a list for a given item, starting with the first element and continues to compare the item w
noname [10]

Answer:

Sequential

Explanation:

Based on the information provided within the question it can be said that the search algorithm that is being described in this scenario is a Sequential algorithm. This is because sequential programming focuses on programming (or in this case searching for) a result by doing one step at a time as opposed to various functions running simultaneously.

7 0
3 years ago
Create a multimedia project that contains the text element and all the contents that you have studied about that element
Marrrta [24]

Answer:

no sé jejejejeje

lslsl

lonsinet

ko

8 0
3 years ago
What are the three primary separation of concerns on the client-side of a dynamic web application? (Check all that apply)
nlexa [21]

Answer:

Behaviour

Style

Structure

Explanation:

Above are the three primary separation of concerns for a web application at client side.

Structure --> we can define the structure of the application at client side using HTML

style-->style is used to give some styling information like font,color,headings so on at client side .In general we use CSS to do this at client side

Behaviour--> it actually defines the functionality of the elements at client side like when we click button what it should do.We will use JavaScript to define the behaviours at client side

7 0
3 years ago
Other questions:
  • When a Firewall is a hardware interface, it is referred as a
    6·1 answer
  • Mr. Perry has bookmarked a large number of webpages in Chrome while researching class topics. Unfortunately, he's bookmarked so
    13·1 answer
  • Which statement about images is correct? A) A virtual image cannot be formed on a screen. B) A virtual image cannot be viewed by
    12·1 answer
  • Exceptions can be handled in all of these ways except:
    6·1 answer
  • A distortion of information about the demand for a product as it passes from one entity to the next across the supply chain is c
    10·1 answer
  • At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
    10·1 answer
  • What is the turns ratio of the transformer T10261
    5·1 answer
  • Consider the following code snippet:
    13·1 answer
  • What is the diffrent between ibm pc and ibm compatibles in table:​
    11·1 answer
  • Which feature of REPL.it would you use to transmit your program to a friend?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!