Return the appropriate part of FizzBuzz This is a small part of a classic software engineering interview question. fizz_buzz_check takes a single integer argument, number. Complete the function such that it returns a value using the following rules: If the number is divisible by 3 (i.e division by 3 has a remainder of 0), return the string Fizz. If it is divisible by five, return the string Buzz. If it is divisible by 3 AND 5, return FizzBuzz. Otherwise, just return the original argument back without any changes.

Answers

Answer 1

Answer:

The function in Python:

def fizz_buzz_check(num):

   if num%3 == 0:

       result = "Fizz"

   if num%5 == 0:

       result = "Buzz"

   if num%3 == 0 and num%5 == 0:

       result = "FizzBuzz"

   if num%3 != 0 and num%5 != 0:

       result = num

   return result

Explanation:

The function to complete is not given. So, I write a new function from scratch.

This defines the function

def fizz_buzz_check(num):

This checks if num is divisible by 3

   if num%3 == 0:

If yes, the returned value is stored as "Fizz"

       result = "Fizz"

This checks if num is divisible by 5

   if num%5 == 0:

If yes, the returned value is stored as "Buzz"

       result = "Buzz"

This checks if num is divisible by 3 and 5

   if num%3 == 0 and num%5 == 0:

If yes, the returned value is stored as "FizzBuzz"

       result = "FizzBuzz"

This checks if num is not divisible by 3 and by 5

   if num%3 != 0 and num%5 != 0:

If yes, the returned value is stored as the initial argument

       result = num

This returns the appropriate value

   return result


Related Questions

Justify any FOUR significant factors to remember when installing your motherboard

Answers

Answer:

The answer is below

Explanation:

When a computer system is being assembled by individuals or to provide a repair. There are factors to remember when installing your motherboard. Some of them include:

1. RAM (Random Acess Memory) support: Ensure the RAM of the PC supports the motherboard capacity.

2. Main Use of the PC: The motherboard to be installed on a PC should be based on the regular usage of the PC.

3. Compatibility with the operating system of the PC is essential. This will allow you to check if it will work well with PC without a glitch

4. Cost of the motherboard: it is advisable to go for a motherboard that can deliver value even if it is somehow expensive.

Is this correct? I say its B, but my friend says its D.

Answers

The answer is B, best of luck!

In python please!!! Write the definition of a function named countPos that reads integer values from standard input until there are none left and returns the number that are positive. The function must not use a loop of any kind.

Answers

Answer:Here is the method countPos    

 static int countPos(Scanner input){ //method that takes a reference to a Scanner object

  int counter=0;  // to count the positive integers  

  int number; //to store each integer value

  if(input.hasNextInt()){ //checks if next token in this scanner input is an integer value

      number=input.nextInt(); //nextInt() method of a Scanner object reads in a string of digits and converts them into an int type and stores it into number variable

      counter=countPos(input); //calls method by passing the Scanner object and stores it in counter variable

      if(number>0) //if the value is a positive number

          counter++;    } //adds 1 to the counter variable each time a positive input value is enountered

  else    { //if value is not a positive integer

      return counter;    } //returns the value of counter

  return counter; } //returns the total count of the positive numbers

Explanation:

Here is the complete program:

import java.util.Scanner; //to take input from user

public class Main { //class name

//comments with each line of method below are given in Answer section

static int countPos(Scanner input){

  int counter=0;

  int number;

  if(input.hasNextInt()){

      number=input.nextInt();

      counter=countPos(input);

      if(number>0)

          counter++;    }

  else    {

      return counter;    }

  return counter; }

public static void main(String[] args) { //start of main function

      System.out.println("Number of positive integers: " + countPos(new Scanner(System.in)));  } } //prints the number of positive integers by calling countPos method and passing Scanner object to it

The program uses hasNextInt method that returns the next token (next input value) and if condition checks using this method if the input value is an integer. nextInt() keeps scanning the next token of the input as an integer. If the input number is a positive number then the counter variable is incremented to 1 otherwise not. If the use enters anything other than an integer value then the program stops and returns the total number of positive integers input by the user. This technique is used in order to avoid using any loop. The program and its output is attached

Explanation:

PLZZ HELP!!!
Select the correct text in the passage.
Dan is working with a team that is integrating an application with a database system. Which of these statements are true with regard to database systems?

1.The testing phase of the SDLC creates databases.
2.Selection of a DBMS occurs during the designing phase of the SDLC.
3.Database development also has a life cycle, with phases similar to those of the SDLC.
4.All compilers intrinsically support database creation.
5.Databases use query language to perform operations.

Answers

Answer:

I don't know

Explanation:

with data you can access all things in the world

Evaluate the following information that shows the projected change in employment from 2014-2024: How can job seekers use the chart? Add data to a résumé and cover letter Gain awareness of how growth trends can impact career plans Research which careers match current skills Talk to community members in a knowledgeable manner You must check the box below prior to submitting your exam! Check this box to indicate you are ready to submit your exam Submit Exam FDK191.10

Answers

Answer:

Answer is B.

Gain awareness of how growth trends can impact career plans

Explanation:

HELP PLZZZZZZZZ!!!!!!!!!!!

Type the correct answer in the box. Spell all words correctly.
Before a new email application could be released to the public, it was released for a few days to some account holders of a website. The project team then collected feedback from this limited number of users and later made the email application available for public use. What type of testing did the project team use?
The project team used_____________testing for the email application.

Answers

Answer:

Its either business format franchise or business brokers

5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

HELPPPPPP How is does technology impact the career of your choice? Write 5-6 sentences about how technology impacts the career of your choice.

Answers

Answer:

Explanation:

Summary. Technology has had a dramatic impact on the nature of work itself, individual applicants and employees, employers, and career counselors. It has changed the nature of work and the types of jobs that people do today. It has altered the knowledge and skills individuals need to be effective workers.

PLZZZ HELP
Select the correct answer.
A company utilizes a specific design methodology in the software design process. They utilize concepts of encapsulation in design. Which design methodology would they be using?
A.
structured design
B.
modular design
C.
object-oriented design
D.
rapid application development
E.
use-case design

Answers

Answer:

C is object-oriented design

Debevec mentions using the technology he described to animate entire human bodies. Discuss why you think this is or is not a good idea? What are some of the challenges that you see with this idea? Explain your answers.

Answers

Answer:

Debevec is using the light of his team because this and that and because it’s manipulated

Explanation:

A financially stable person is able to:
A. spend money without having to save.
B. use loans to cover his or her living costs.
C. default on loan payments.
D. save money.

Answers

I think D. To save money cuz thats how financially stable people stay financially stable

Answer:

Save Money

Explanation:

D

What do y’all think are the pros and cons to using technology?

Answers

Answer:

Explanation:

pros. convenient, easy to use, and educational  cons. addictive, mentally draining, and creates a social divide.

The aim of this activity is to implement an algorithm that returns the union of elements in a collection. Although working with sets is quick and easy in Python, sometimes we might want to find the union between two lists. Create a function called unite_lists, which uses a loop to go through both lists and return common elements. Do not use the built-in set function.

Answers

Answer:

The function in Python is as follows:

def unite_lists(A, B):

   union = []

   for elem in A:

       if elem in B:

           union.append(elem)

   return union

Explanation:

This defines the function

def unite_lists(A, B):

This initializes an empty list for the union list

   union = []

This iterates through list A

   for elem in A:

This checks if the item in list A is in list B

       if elem in B:

If it is present, the item is appended to the union list

           union.append(elem)

This returns the union of the two lists

   return union

Consider the following relation with functional dependencies as shown below.R{sno,sname,age,cno,cname,group}
R(A,B,C,D,E,F)
A-B,C
C-F
D-E
which normal form is the relation R is in?

Answers

Answer:

First Normal Form

Explanation:

The correct answer is - First Normal Form

Reason -

Given that,

A-B,C

C-F

D-E

Here the key is AD

The two partial Functional dependencies are -

A-B,C  

D-E

So,

They are not in Second Normal Form, but they are in First Normal Form.

⚠️⚠️⚠️⚠️HELP - What is the software that allocates resources of a physical computer to a virtual machine?
Group of answer choices

Switch

Operating systems

Hypervisor

HostVM

Answers

Answer:

the answer is going to be hostvm

PLZZZ HELP!!!
Select the correct answer.
A testing team has a new software application to test. While writing the test plan, the team enters some functions that are out of scope for the current phase of testing. In which section of the test plan will you find these functions?
A.
Introduction
B.
Features not to Test
C.
Deliverables
D.
Dependencies

Answers

Answer:

D the answer is D or c one of those 2

Aspire is a test you take to prepare for the
A. PSAT
B. SAT
C. ACT
D. FAFSA

Answers

Answer:

ACT

Explanation:

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing." - https://greentestprep.com/resources/act-prep/act-aspire-test/

Aspire is a test you take to prepare for the ACT. Thus, option C is correct.

What is ACT?

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing.Aspire is a test people take as a preparation for both ACT a d SAT.

Aspire is a valuable tool to help students and their parents monitor progress towards a good ACT exam from 3rd to 10th grade. The Aspire test assesses student performance in five areas covered by the ACT exam: English, math, reading, science and writing. Aspire Test is offered in the spring and fall seasons, the cost of the assessment tool depends on how many subjects you would like to measure and how often you want your student to be tested.

Learn more about Aspire Test on:

https://brainly.com/question/4469429

#SPJ7

Which option is used to determine whether information that should remain private is included in the final version of a PowerPoint presentation?
Compatibility Check
Grammar Checker
Document Inspector dialog box
Trust Center

Answers

Answer:

Im pretty sure you should put a document inspector dialog box

Answer:

Document Inspector dialog box

Explanation:

edge 2022

What are the two main parts of system unit hardware?

Answers

Answer: Computers have two main parts: hardware and software

Like piano (hardware) and music (software)

Explanation:

A digital footprint is .

Answers

Your digital footprint is the trail of 'electronic breadcrumbs' you leave behind when you use the internet. It can include the websites you visit, the photos you upload and your interactions with other people on social networks.

Answer: is something you must manage

Edna needs a safer car to drive. She likes to travel a lot, so she is looking for a small SUV. She is trying to decide between buying a new or used car. After doing some research, she finds out that most cars lose value each year by a process known as depreciation. You may have heard before that a new car loses a large part of its value in the first 2 or 3 years and continues to lose its value, but more gradually, over time. That is because the car does not lose the same amount of value each year, but it loses approximately the same percentage of its value each year. What kind of model would be most useful for calculating the value of a car over time?

Answers

Answer: Buy a new car

Explanation: If its a used car its breaks will be worn out and more likely the breaks will stop working in 6 months and you have to change them. May the forse be with you.

Create a program that: Provides access to a rolodex (list of names and contact information). Have the program accept a name to lookup and that prints the contact information of the matching name. Use an array for names and an array for email address and another array for phone numbers. Make sure that all three arrays contain corresponding information.

Answers

Answer:

Explanation:

The following code is written in Java, it asks the user for a name and looks that name up in the names array. If it finds it prints out all the values in that same index within every array to get the name, email, and phone number. If the name is not found it prints out that the client is not found.

//The code is attached in the text file below and picture shows the output of the working code.

The number of P/E cycles that a solid-state drive can support may vary, within what range?
o
1 to 100
1,000 to 100,000
10,000 to 10 million
10 billion to 10 trillion

Answers

Answer:

C. 10,000 To 10 Million

Explanation:

Got It Right On Edge

Answer:

the answer is C. 10,000 to 10 million

Explanation:

i took the test on edge

to be useful for most household applications, DC voltage is?please

Answers

Answer: To be useful for most household applications, DC voltage is passed through a step-down transformer.

Explanation: Voltage coming through AC or DC outlets is typically far too high for most household appliances to handle, so the current is passed through a step-down transformer to reduce the voltage to a usable level.

. What is piracy? ???????????????????​

Answers

Answer: a practice similar to piracy but in other contexts, especially hijacking.

"air piracy"

the unauthorized use or reproduction of another's work.

Explanation:

PLS HELP WILL MARK BRAINLINESS AND 30 POINTS
In your own words in at least two paragraphs, explain why it is important, when developing a website, to create a sitemap and wireframe. Explain which process seems most important to you and why you feel most drawn to that process.

(i.e. paragraph one is why is it important and paragraph two is which process felt most important to you and why)

Answers

When creating a website, it is important to create a sitemap so that a search engine can find, crawl and index all of your website's content. a sitemap makes site creation much more efficient and simple. A sitemap also helps site developers (assuming you have any) understand the layout of your website, so that they can design according to your needs.

A wireframe is another important step in the web design process. Creating a website is like building a house. To build the house, you first need a foundation on which to build it upon. Without that foundation, the house will collapse. The same goes for a website. If you create a wireframe as a rough draft of your website before going through and adding final touches, the entire design process will become much easier. If you do not first create a wireframe, the design process will be considerably more difficult, and you are more likely to encounter problems later on.

To me, the wireframe is the most important due to the fact that is necessary in order to create a good website. In order to create a sitemap, you first need a rough outline of your website. Without that outline, creating a sitemap is impossible.

which of the following is an example of bias in media?
A. a website that represents a controversial opinion as though it were fact
B. a television news program that presents both sides of a particular issue
C. a podcast expressing an authors opinion
D. a blog about the history of the civil war

Answers

Answer is A because stating a opinion as a fact is bias.

a website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

What is Website?

A website is a group of interconnected, publicly accessible Web pages with a common domain name. A website can be developed and maintained to serve a variety of objectives by an individual, group, company, or organization.

The World Wide Web is made up of all websites that are open to the public.

Although it is occasionally referred to as a "web page," this description is incorrect because a website is made up of multiple webpages. A "web presence" or simply "site" are other names for websites.

Therefore, A website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

To learn more about Website , refer to the link:

https://brainly.com/question/29777063

#SPJ2

Can someone plz answer these questions plz

Answers

Answer:

ñbyte I'm pretty sure, sorry if u get it wrong you should do more research about the question if i get it wrong!!

PLZZZ HELP
Select the correct answer.
Ed is the manager of a software design team. He needs to call a design review meeting. Who should he call for this meeting?
A.
only the stakeholders and external reviewer
B.
stakeholders and technical team
C.
the technical team and external reviewer
D.
only the technical team
E.
only the external reviewer and stakeholders

Answers

I think the answer is C

Answer:

C: the technical team and external reviewer

Explanation:

Plato/Edmentum

who was the first inventor of computer​

Answers

Answer:

Explanation:

English mathematician and inventor Charles Babbage is credited with having conceived the first automatic digital computer. During the mid-1830s Babbage developed plans for the Analytical Engine.

Answer:

Charles Babage is the first inventor of computer.

Other Questions
The manager of a sporting goods store raises the price of a basketball from $16 to $18. What is the percent increase? PLEASE HELP I AM TIMEDDDDD I WILL GIVE BRAINLIEST IF CORRECT- DONT DO FAKE ANSWERSWhat is the total surface area of the square pyramid below?132 m2144 m2160 m2228 m2 PLZ HELP IN PHOTO will give brainlist Can someone please help me :( What is primary socialization?O A. The learning of work skills and knowledge by teenagersB. The sharing of gossip between family and friendsC. The division of household jobs and chores among adultsD. The teaching of values and attitudes to young children 5. At Michael's store, a paint set is on sale for $39.99. The original price was$66.65. What percent of the original price is the sale price? PLS HURRY Which of these statements is most accurate regarding mortgage payments through the life of your loan?a.At the beginning of your loan, your payments are covering mostly interest. At the end of your loan, your payments are covering mostly principal.b.The amount for your mortgage payments will decline over the life of your loan.c.The amount of interest paid per mortgage payment will remain the same over the life of your loan.d.The amount of principal paid per mortgage payment will decrease over the life of your loan.Please select the best answer from the choices providedABCD Line d is parallel to line c in the figure below.Which statements about the figure are true? Select three options.A. Vertical angles prove that Angle 2 is congruent to angle 5.B. In the two similar triangles, Angle 1 and Angle 4 are alternate interior angles.C. Vertical angles prove that Angle 3 is congruent to angle 6.D. The triangles are similar because alternate interior angles are congruent.E. In the two similar triangles, Angle 2 and Angle 4 are corresponding angles.F. The triangles are similar because the corresponding sides are congruent. Cameron runs 2.4 miles 3 days a week. How many miles does he run total in one week? Which explains why an author might write in first person? How old would cleopatra be today? How old would her parents be 200 years from now? Can someone give me 5 reasons why social media affects your life or mental health In a random sample of 42 Democrats from one city, 10 approved of the mayor's performance. In a random sample of 58 Republicans from the city, 12 approved of the mayor's performance. Find a 90% confidence interval for the difference between the proportions of Democrats and Republicans who approve of the mayor's performance. 6383 to the nearest hundred In the book Dark Water Rising why is Seth and his father in the conflict The heights of five-year-olds are Normally distributed with a mean of 42.5 inches and a standard deviation of 2.5 inches. A random sample of 16 five-year-olds is taken and the mean height is recorded. What would be the standard deviation of the sampling distribution of all possible samples of size 16?0.160.632.52.66 Will give brainliest!!How much KClO3 is needed to make a saturated solution in 100 mL of water at 70 C? The graph of a quadratic function has a vertex (3,-1). What is the domain and the range? The graph is pointing downward what did the partisan press era do for the national debate? Action and reaction forces are described by which of Newton's laws of motion?firstsecondthirdfourth