Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times the character appears in the phrase.

Answers

Answer 1

Answer:

The program in Python is as follows:

print("Enter a character followed by a phrase",end='')

word = input(": ")

char = word[0]

print("Occurrence: "+str((word.count(char))-1))

Explanation:

The prints an instruction to the user on how to input to the system

print("Enter a character followed by a phrase",end='')

This prompts and gets the user for input

word = input(": ")

This extracts the character from the input string

char = word[0]

This counts and prints the number of occurrence of the extracted character

print("Occurrence: "+str((word.count(char))-1))


Related Questions

In the 2018-2019 softball season, Allison hit the ball 28 out of 67 times, this included fouls. What was her percentage
of misses?

Answers

Answer:

Allison missed 58.21% of the times.

Explanation:

The first step is to divide 28 by 67 to get the answer in decimal form:

28 / 67 = 0.4179

Then, we multiplied the answer from the first step by one hundred to get the answer as a percentage:

0.4179 * 100 = 41.79%

Then 100(%) - 41.79(%) = 58.21%

Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enough space in the array to double the size.

Answers

Answer:

The solution in Python is as follows:

class myClass:

    def doubleUp(self,doubleList):

         doubleList[:0] = doubleList[::2] = doubleList[1::2] = doubleList[:]

       

newlist =  []

n = int(input("Number of elements: "))

for i in range(n):

    num = int(input(": "))

    newlist.append(num)

   

list = myClass()

list.doubleUp(newlist)

print(newlist)

Explanation:

Start by creating a class

The solution in Python is as follows:

class myClass:

Then define the method doubleUp

    def doubleUp(self,doubleList):

The duplicates is done here

         doubleList[:0] = doubleList[::2] = doubleList[1::2] = doubleList[:]

The program main begins here

This defines an empty list        

newlist =  []

This prompts user for number of elements

n = int(input("Number of elements: "))

The following iteration get the elements of the list

for i in range(n):

    num = int(input(": "))

    newlist.append(num)

   

This defines the instance of the class

list = myClass()

This calls the method

list.doubleUp(newlist)

Lastly, this prints the duplicate list

print(newlist)

If we assume the modern view of existential import, why is the following syllogism invalid? No computer is made of clay. All computers are electronic devices. Some electronic devices are not made of clay.

Answers

Answer:

because the conclusion is not in agreement with the two premises.

Explanation:

Remember, the term syllogism refers to the form of reasoning that draws its conclusion based on the stated premises. In other words, a conclusion is reached if it satisfies all or part of the premises.

In this case, the statement "No computer is made of clay" and  "All computers are electronic devices" should be inferred to mean, No electronic devices are made of clay" not "Some electronic devices are not made of clay," since the two premises neither suggest that electronic devices are made from clay.

The reason why the given syllogism is invalid is because; The conclusion does not agree with the premise.

We are given two statements as premises;

1) No computer is made of clay

2) All computers are electronic devices

The third statement is the conclusion which states that;

3) Some electronic devices are not made of clay.

Now in syllogism, the conclusion must be in agreement with the two premises.

In this question, the conclusion doesn't agree with the premises because the conclusion says "some electronic devices are not made of clay". Whereas the premise says that no computer which is an electronic device is made of clay.

Since none of the premise suggests that any electronic device is made of clay, then the syllogism is invalid.

Read more about syllogism at; https://brainly.com/question/1622136

ELO 3.6 Which type of iSCSI name requires a registered domain name to generate a unique iSCSI identifier?

Answers

Answer:

iSCSI Qualified Name (IQN).

Explanation:

iSCSI is simply an acronym for Internet Small Computer Systems Interface and it is typically an internet protocol (IP) with respect to a storage area network (SAN) standard used essentially for connecting data storage facilities over a transmission control protocol and internet protocol (TCP/IP).

iSCSI Qualified Name (IQN) is a type of iSCSI name that requires a registered domain name to generate a unique iSCSI identifier.

This ultimately implies that, a data storage organization must have a registered domain name in order to be able to generate an iSCSI Qualified Name (IQN). Also, the iSCSI Qualified Name (IQN) is not linked to an internet protocol (IP) address and as such it is considered to be a logical name.

Timothy is an architect. He needs to create a prototype of a new apartment that his firm is building. Which multimedia software would he use? A. image editing program B. painting program C. animation program D. digital video program E. 3D modeling program

Answers

E. 3D modeling program! This will always been used for architectural designing, a software example would be Archicad.

True or False: Kitchen lighting can be included on a small appliance branch circuit.. Single line text.

Answers

The answers is False

Write a method, public static void selectSort(ArrayList list), which implements a selection sort on the ArrayList of Integer objects list. For example, if the parameter list would be printed as [3, 7, 2, 9, 1, 7] before a call to selectSort, it would be printed as [1, 2, 3, 7, 7, 9] after the method call.

Answers

Answer:

Explanation:

The following code is written in Java and like asked in the question, it is a function that takes in an ArrayList of Integers as a parameter and uses selection sort to sort the array.

public static void selectSort(ArrayList<Integer> list) {

                       for (int i = 0; i < list.size() - 1; i++)

                       {

                               int index = i;

                               for (int j = i + 1; j < list.size(); j++){

                                       if (list.get(j) < list.get(index)){

                                               index = j;

                                       }

                               }

                               int smallerNumber = list.get(index);

                               list.set(index, list.get(i));

                               list.set(i, smallerNumber);

                       }

               }

Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use

Answers

Question:

Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the gas equation PV = nRT, where P is pressure in Pascals, V is volume in cubic meters, n is number of moles, R is the gas constant 8.3144621 ( J / (mol*K)), and T is temperature in Kelvin.

Answer:

This solution is implemented in C++

double compute_gas_volume(double P, double T, double n){

   double V = 8.3144621 * n * T/P;

   return V;

}

Explanation:

This line defines the function, along with three parameters

double compute_gas_volume(double P, double T, double n){

This calculates the volume

   double V = 8.3144621 * n * T/P;

This returns the calculated volume

   return V;

}

To call the function  from the main, use:

cout<<compute_gas_volume(P,T,n);

Where P, T and n are double variables and they must have been initialized

_________________ allows cloud controller to locate instances on separate zones to boost redundancy.

Answers

Answer:

_____Router___ allows the cloud controller to locate instances on separate zones to boost redundancy.

Explanation:

A router, as a networking device, forwards data packets between one computer network and other networks.  With a router, one can use wired and wireless devices to connect to the Internet.  Unlike a modem, which connects the home network to a wider internet, a router can enable the networks to interact with one another without using the Internet.

To bundle links together in order to improve bandwidth availability and redundancy, what protocol is used

Answers

Answer:

Link Aggregation Control Protocol

Explanation:

Link Aggregation Control Protocol can be used to assist in the formation of port channel bundles of physical links.

Link Aggregation Control Protocol is an IEEE standard defined in IEEE 802.3ad. LACP lets devices send Link Aggregation Control Protocol Data Units (LACPDUs) to each other to establish a link aggregation connection.

Write a method that accepts a number of seconds and prints the correct number of hours, minutes, and seconds.

Answers

Answer:

This solution is implemented in Java

public static void timme(int seconds) {

       int hours = seconds/3600;

       System.out.println("Hours: "+hours);

[tex]seconds = seconds - hours * 3600;[/tex]

       int minutes = seconds/60;

       System.out.println("Minutes: "+minutes);

[tex]seconds = seconds - minutes * 60;[/tex]

       System.out.println("Seconds: "+seconds);

   }

   

Explanation:

This method defines the method along with one parameter

public static void timme(int seconds) {

This calculates hours from the seconds

       int hours = seconds/3600;

This prints the calculated hours

       System.out.println("Hours: "+hours);

This calculates the seconds remaining

    [tex]seconds = seconds - hours * 3600;[/tex]

This calculates the minutes from the seconds left

       int minutes = seconds/60;

This prints the calculated minutes

       System.out.println("Minutes: "+minutes);

This calculates the seconds remaining

    [tex]seconds = seconds - minutes * 60;[/tex]

This prints the seconds left    

  System.out.println("Seconds: "+seconds);

   }

2. A __________ is a single function that the program must perform in order to satisfy the customer.

Answers

Answer:   A software requirement is a single function that the program must perform in order to satisfy the customer.

Explanation:

A program is a set of instructions or commands that are required to perform a job.  So before programming , we should know what we want our program to do so we can do it and then verify it.

The set of required tasks in our program is called as software requirement.

These are agreed by the customer and the developer before hand. Each software requirement describe a single wanted functionality from our program.

Write a java program named SumThousand The program adds all the number from 1 to 1000 together and print out the sum

Answers

Answer:

The program in Java is as follows:

public class SumThousand  {

   public static void main(String args[]) {

     int sum=0;

     for(int i =1;i<=1000;i++)

         sum+=i;

     

     System.out.println("Sum = " + sum);

   }

}

Explanation:

This initializes sum to 0

int sum=0;

This iterates from 1 to 1000

     for(int i =1;i<=1000;i++)

This calculates the required sum

         sum+=i;

     

This prints the calculated sum

     System.out.println("Sum = " + sum);

   

please help me please i really need helpp so i can pass

Answers

Answer:

Piezoelectric gauge is used to convert charge into measureable electric signal.

Universal serial bus interface allows a computer and flash drive to exchange information.

Analytical balance is used to measure mass

Ultrasonic flow sensors measure the seed of water using ultrasonic waves.

Explanation:

Analytical balance is used to measure mass. An analytical balance is a device that can measure the mass of an object  accurately. It can also measure very small amount of mass with a range between 0.1mg - 0.01mg.

Universal serial bus interface allows a computer and flash drive to exchange information. A Universal Serial Bus (USB) is an interface that allows communication between peripheral devices and a computer. It connects peripheral devices such as mouse, keyboards, printers, scanners, external hard drives and flash drives with the computer.

Piezoelectric gauge is used to convert charge into measureable electric signal. A piezoelectric gauge has a piezoelectric sensor that uses piezoelectric effect to measure changes in pressure, temperature, force and convert these changes into electrical charge.

Ultrasonic flow sensors measure the speed of flowing liquid using ultrasonic waves. It uses sound waves to determine the speed of the liquid.

what are the qualities of different products that caught your eye and encourage you to buy them​

Answers

Answer:

The qualities of different products that caught your eye and encourage you to buy them​ is described below in detail.

Explanation:

A fantastic method to do this would be to practice shiny colors in any advertisement you publish. This is an old method, but it's a great one. Glowing orange, for example, is sure to hold watching much higher than bland shades like gray. Play throughout here, and apply the color you think illustrates the eye most.

Write a program that first gets a list of integers from input. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds).

Answers

Answer:

The program in Python is as follows:

mylist = []

num = int(input("Length: "))

for i in range(num):

    inp = int(input(": "))

    mylist.append(inp)

lower = int(input("Lower Bound: "))

upper = int(input("Upper Bound: "))

for i in mylist:

    if i >= lower and i <= upper:

         print(i, end=" ")

Explanation:

This initializes an empty list

mylist = []

The prompts the user for length of the list

num = int(input("Length: "))

The following iteration reads input into the list

for i in range(num):

    inp = int(input(": "))

    mylist.append(inp)

This gets the lower bound of the range

lower = int(input("Lower Bound: "))

This gets the upper bound

upper = int(input("Upper Bound: "))

This iterates through the list

for i in mylist:

This checks for elements of the list within the range

    if i >= lower and i <= upper:

This prints the list element

         print(i, end=" ")

Answer:input_numbers = [int(x) for x in input().split(' ')]

input_range = [int(x) for x in input().split(' ')]

for number in input_numbers:

   if input_range[0] <= number <= input_range[1]:

       print('{}'.format(number), end = ' ')

Explanation:

Give ways on how to effectively save.​

Answers

Answer:

Explanation:

say goodbye to debt. Monthly debt payments are the biggest money suck when it comes to saving. ...

Cut down on groceries. ...

Cancel automatic subscriptions and memberships.

How important "saving" in every individual?​

Answers

Answer:

The importance of saving money is simple: It allows you to enjoy greater security in your life. If you have cash set aside for emergencies, you have a fallback should something unexpected happen. And, if you have savings set aside for discretionary expenses, you may be able to take risks or try new things.

How do you change the order of the slides in your presentation in the slide pane 
Copy and paste
Delete
Drag and drop
Remove

Answers

Drag and drop! Good luck

Answer:

Hold down on your slide number and then pull in the order

Explanation:

Remember push down the pull up

Plz help doe today 15 points

Answers

Answer:

there nothing in the doc

Explanation:

What are the characteristics of desktop alerts in Outlook 2016? Check all that apply.
On-screen notifications will pop up for new emails, meeting invites, and new tasks.
Email pop-ups will display the sender's name, subject, and a small bit of the message.
Reading the pop-up alert is the best way to read email messages.
Desktop alerts cannot be turned off.
O Sound notifications can be customized.

Answers

Answer:

A & B

Explanation:

Answer:

A. On-screen notifications will pop up for new emails, meeting invites, and new tasks.

B. Email pop-ups will display the sender’s name, subject, and a small bit of the message.

E. Sound notifications can be customized.

Explanation:

this is for Outlook 2019

Please helpppp. Rearrange the parts of the program to generate two random integers and then ask the user to guess the greatest common divisor.
First part
Second part
Fourth part
Third part

1. from math import gcd
from random import randrange

numA=randrange(6,50,2)

numB = randrange(6,30,2)

if guess == answer:

print("Good job! You are right.")

print("The right answer is",answer)

answer = gcd(numA,numB)
guess = input("Greatest common divisor of " + str(numA) + " and " + str(numB) + "? " )

Answers

Answer:

first part:

from math import gcd  

from random import randrange

second part:

numA=randrange(6,50,2)

numB = randrange(6,30,2)

third part:

answer = gcd(numA,numB)

guess = input("Greatest common divisor of " + str(numA) + " and " + str(numB) + "? " )

fourth part:

if guess == answer:  

print("Good job! You are right.")

print("The right answer is",answer)

Explanation:

got it right on edge

C++ Random Number Generation with a Range The modulus operator can produce random numbers in any range, much like 1 and 10 do. For instance, you could write int random = 1+ (rand()% 100) to produce numbers between 1 and 100.

What programs to generate two random integers?

In the C/C++ computer languages, random number generation is accomplished using the rand() and srand() methods. The srand() value is fixed at 1, therefore the rand() function always produces the same results.

When we run the program, the same random number will be generated each time by the C++ rand() function. The srand (unsigned int seed) function is used to seed the rand() function.

Therefore, The pseudo-random number generation's starting point is set by the srand() function.

Learn more about random integers here:

https://brainly.com/question/15247918

#SPJ2

The following program calculates yearly and monthly salary given an hourly wage. The program assumes a work-hours-per-week of 40 and work-weeks-per-year of 50. Insert the correct number in the code below to print a monthly salary. Then run the program. The monthly salary should be 3333.333... .

Answers

Answer:

The program implemented in Python is as follows:

hourly=float(input("Hourly Wage: "))

print("Annual Rate: "+str(hourly * 40 * 50))

print("Monthly Rate: "+str(round((hourly * 40 * 50/12),2)))

Explanation:

The question is incomplete as the missing code is not given. However, I've written the program from scratch in python.

This prompts the program user for the hourly Wage;

hourly=float(input("Hourly Wage: "))

This calculates and prints the annual rate

print("Annual Rate: "+str(hourly * 40 * 50))

This calculates and prints the monthly rate

print("Monthly Rate: "+str(round((hourly * 40 * 50/12),2)))

Note:

The annual rate is calculated by multiplying the hourly wage to number of hours per week (40) to number of weeks per year (50)

The monthly rate is calculated by [tex]annual\ rate/12[/tex]

To find any information on the Internet, we enter specific keywords into a search engine. What happens next

Answers

Answer:

Answer A

Explanation:

2.20 Write an expression involving a three-letter string s that evaluates to a string whose characters are the characters of s in reverse order. If s is 'top', the expression should evaluate to 'pot'.

Answers

Answer:

The program in Python is as follows:

s = input("Three letter string: ")

if(len(s)==3):

    print(s[::-1])

else:

    print("Invalid length")

Explanation:

This prompts the user for a three-letter string

s = input("Three letter string: ")

The following if condition checks if the length of the string is 3. If yes, it reverses and print the reversed string

if(len(s)==3):

    print(s[::-1])

If otherwise, it prints "Invalid length"

else:

    print("Invalid length")

What is the software system design to locate information on the World Wide Web
search browser
Search engine
Search keyboard
Search result

Answers

Answer:

Search engine

Explanation:

Answer:

search engine

Explanation:

create a function that draws a certain number of spaces, followed by a certain number of stars, followed by a newline.

Answers

Answer:

Explanation:

The following code is written in Python and creates a function called create_sentence which takes in 2 parameters which are the number of spaces and the number of stars. Then it uses these values to create the sentence and return it.

def create_sentence(spaces, stars):

   sentence = ""

   for x in range(spaces):

       sentence += " "

   for x in range(stars):

       sentence += "★"

   sentence += "\n"

   return sentence

A company is completing research and development for software which it is planning to produce in approximately 2 years time. Which of the following assumptions should the company make about the processing speeds of the hardware which will be used to run this software.

Answers

Answer:

true tbh I don't really Know

A drop light that does not allow any electrical parts to come in contact with the outer casing of the device is called a:

Answers

Answer:

The right answer is "Double insulated light".

Explanation:

Double insulated led is mostly a sophisticated type of natural light that does not necessitate a terrestrial or planetary correlation. These illuminations could be based on these metals, are indicated in the electrical protection environmental standards that now the construction workers comply with, and therefore are readily accessible about every bedroom.

Am giving BRAINLIEST!!!!!!! Assume you have entered the following after a prompt. >>> import time
How would you pause a program for 5 seconds?

Answers

Answer:

time.sleep(5)

Explanation:

Other Questions
Question 7 Elijah is planning a circular flower garden with a 12 foot diameter. He will put plastic edging along the flowerbed. How many feet of edging will Elijah need to enclose his flower garden? Round to the nearest tenth place. (Use 3.14 for pi) If you don't know please don't try and help. (3x+23x +32) = (x+6) The law of conservation of mass states that matter can/cannot be createdor destroyed, even after a chemical changea. Canb. Cannot SN Chemistry ArchivesMeet tyrimCopy of LFA VOORSELF-ASSESSMENT QUESTIONS4 Jaina is planning a study about false memories. Shewants to compare false memories about emotionalevents and false memories about non-emotional events.a Suggest how Jaina could operationally define theIV in her studyb Suggest one possible ethical problem with Jaina'sstudy. Mark's brother is five years or than mark. thier ages combinded adds up to 23. How old is mark Carl buys songs and downloads them to his computer. The bar graph shows the numbers of each type of song he downloaded last year. What fraction of the songs were country? Find the fraction for each type of song. Write each fraction in simplest form and give its percent equivalent. Use the syntax SELECT ________ (expression) [Column Name] to limit the result set to the number of rows defined by the expression. Answer the essay question using the appropriate verb tense.Qu recuerdas de tu niez?Just a 2 sentence response. What is the molarity of a solution in which 0.321 g of calcium chloride is dissolved in 1.45 L water? Helppppp pleaseeee xxxx An object with velocity 141 ft/s has a kinetic energy of 1558.71 ftlbf, on a planet whose gravity is 31.5 ft/s2. What is its mass in pounds Find the value of 17.64 Firms are organizations that A) take advantage of the public. B) transform resources into products. C) transform outputs into inputs. D) demand consumer outputs I will mark you brainiest if you can answer this Malcolm was playing golf with some friends. The game became quite competitive and Malcolm was focused on earning bragging rights by beating his friends with the lowest score. After hitting his tee shot into an area that was close to out of bounds with very tall grass, Malcolm found a golf ball among the weeds. As he looked at the ball, he realized it wasn't the ball he hit from the tee. How can Malcolm demonstrate appropriate etiquette in this friendly golf game? (2 points)Admit that he cannot find his ball and go back to the tee box to hit another oneHit the ball that he found because he is sure his ball is close by but the grass is too tall to see itKick the ball he found into the open and take a penalty stroke if he is at least two shots aheadTell his playing group that he is not going to stop looking for his ball no matter how long it takes What is the greatest common factor of the terms of the polynomial below12x4 - 6x3 + 9x2 What is the lowest possible energy level that an electron can occupy? (1+3p)(1-3p)the answer is 1-9p How do i get this though? Angela purchased a storage cube with a volume of 10 cubic feet. She wants to put it on a shelf that is 24 inches tall.A. Yes, because the height of the cube is approximately 4.93 inches.B. Yes, because the height of the cube is approximately 2.15 inches.C. No, because the height of the cube is approximately 25.85 inches.D. No, because the height of the cube is approximately 39.96 inches. Can someone pls help me?