1. Create an optimized function "print s(n,s)" that prints the given argument s (representing a string) k times. k represents the number of iterations of the inner loop. The print statement that prints s is in the inner loop of the function (a) Initial conditions: i = 1, j = 1, i <= n, and j <= i (b) i and j increments: i = i + 1 and j = j ∗ 2 (c) input as arguments in the function: n (an integer representing the size of the input), and s (the string) (d) output: print s k times (e) example: n=5, s="hello CSC510-01 class", given these conditions, the function "print s(n,s)" will print s 11 times

Answers

Answer 1

Answer:

The program in C is as follows:

void prints(char arr[], int n){

   int count =0;

   for(int i=1 ;i<=n; i++){

   for(int j=1;j<=i; j=j*2){

   count++;    }    }  

   for(int i =0;i<count;i++){

       printf("%s ",arr);

   }

}

Explanation:

This defines the method

void prints(char arr[], int n){

This declares and initializes count variable to 0

   int count =0;

This creates the outer loop

   for(int i=1 ;i<=n; i++){

This creates the inner loop

   for(int j=1;j<=i; j=j*2){

This increments count by 1

   count++;    }    }  

This iterates through count

   for(int i =0;i<count;i++){

And print the string in count times. If count is 3, the string will be printed 3 times.

       printf("%s ",arr);

   }

}

See attachment for complete program that includes the main method


Related Questions

What was the Internet was built off ot?
A) IPv6
B) CIDR
C) NAT
D) IPv4

Answers

Answer:

The internet was built around IPv4.

Give a regular expression for binary numbers. They can be integers or binary fractions. A leading - sign is always allowed. Leading 0's are not allowed except when the integer part is 0. When the binary points is present, then neither the integer part nor the fractional part are allowed to be empty. If the integer part has more than 3 bits, then grouping with commas is required. Examples: Allowed: -0 1,111,010 -1,111.00 Not allowed: .11 1000 The 4-letter alphabet consists of 0, 1, dot, and comma.

Answers

Solution :

We have to provide an expression for the binary numbers. There can be binary fractions or integers. Whenever there is leading 0, it is not allowed unless the integer part is a 0.

Thus the expression is :

[tex]$(-+ \in )$[/tex] [tex]$[(1+10+11+100+101+110+111)(,000+,001+,010+,011+,111+,100+,101+,110)^*$[/tex] [tex]$(\in +.(0+1)^*(0+1))+(0.(0+1)^*(0+1))]$[/tex]

In this exercise we have to have knowledge about binary code to calculate with these numbers, so we have:

[tex](E+(0+1)*(0+1))[/tex]

What is a binary code?

A binary code represents text, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often "0" and "1" from the binary number system.

Knowing this now we can perform the calculations like:

[tex](1+10+11+100+101+110+111)(000+001+010+011+111+100+101+110)\\(E+(0+1)*(0+1))[/tex]

See more about binary code at brainly.com/question/7960132

it is important organic mineral that is found in the soil as ash​

Answers

Answer:

Calcium is the most abundant element in wood ash and gives ash properties similar to agricultural lime. Ash is also a good source of potassium, phosphorus, and magnesium.

Huh this is very confusing

// The QuickCopy company currently makes 100,000 copies per year// at 15 cents each.// They expect to increase the number of copies produced// by 4 percent per year each year for the next 10 years,// starting with this year.// They also expect the price of each copy to increase// by 3 cents per year, starting with this year.// This program displays the company's expected// income for each of the next 10 years.// Modify it to be more efficient.startDeclarationsnum year = 1num copies = 100000num price = 0.15num total = 0num COPIES_INCREASE = 0.04num PRICE_INCREASE = 0.03copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalyear = year + 1copies = copies + copies * COPIES_INCREASEprice = price + price * PRICE_INCREASEtotal = total + copies * priceoutput year, totalstop

Answers

Answer:

See Explanation

Explanation:

Required

Modify the program

To modify the program, we simply make use of an iterative statement.

To do this, I'll make use of a do while loop.

So, we have:

Declarations

num year = 1

num copies = 100000

num price = 0.15

num total = 0

num COPIES_INCREASE = 0.04

num PRICE_INCREASE = 0.03

do:

copies = copies + copies * COPIES_INCREASE

price = price + price * PRICE_INCREASE

total = total + copies * price

output year, total

year = year + 1

while year<=10

The above do while loop enables the program to repeat the statements in the following block:

do:

----

---------

---

-

while year <=10

The loop calculates the copies & price in each year and also updates the values of the variables; so that they can be used for the nexr iteration

What are the disadvantages of using folders ​

Answers

Answer:

√ folders can cause some inconvenience situation...

√ The decompress / compress action takes time.

√ When you double-click on a file inside a “folder”, what really happens is the file gets extracted to a temporary folder.

heres one:

when you delete a folder, he stuff inside gets deleted, and there isnt a way to get it back.

Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between them. The formula for computing the distance is: Square root of ((x2 - x1) squared + (y2 - y1) squared) Note that you can use pow(a, 0.5) to compute square root of a.

Answers

Answer:

x1 = input("enter x value of first number: ")

y1 = input("enter y value of first number: ")

x2 = input("enter x value of second number: ")

y2 = input("enter y value of second number: ")

ans = (float(x2)-float(x1))**2 + (float(y2)-float(y1))**2

ans = pow(ans, 0.5)

print(ans)

What is a Web server application?
A.An application that receives information, provided by an end user on a user-input form, from a Web server or a database server.
B.An application that is used to make Webpages interactive
C.An application that stores and processes the information provided by an end user on a user-input form
D.An application that authoritatively confirms the identity of a person, host or organization

Answers

Answer:

I prefer to go for the answer D

Which function will display 6 as the output in the following formula?
C1*(C2+B1)
where C1 is 6, C2 is 2, and B1 is 4
_________

Answers

Answer:

36

Explanation:

hi add creeper_king101 i need views on snap

Answer: i just did the pretest and the answer was 36 no cap

Explanation:

A restaurant buys a pizza oven that is 4.5 feet long, 5 feet wide and 6 feet tall. What is the volume of the pizza oven?

Answers

Answer:

135 as 4.5 times 5 times 6 gives you the volume and it =135

Your goals as the IT architect and IT security specialist are to:  Develop solutions to the issues that the specified location of IDI is facing.  Develop plans to implement corporate-wide information access methods to ensure confidentiality, integrity, and availability.  Assess risks and vulnerabilities with operating IT facilities in the disparate locations where IDI now functions and develop mitigation plans and implementation methods.  Analyze the strengths and weaknesses in the current systems of IDI.  Address remote user and Web site user’s secure access requirements.  Develop a proposed budget for the project—consider hardware, software, upgrades/replacements, and consulting services.  Prepare detailed network and configuration diagrams outlining the proposed change to be able to present it to the management.  Develop and submit a comprehensive report addressing the learning objectives and your solutions to the issues within the scenario.  Prepare a 10- to 15-slide PowerPoint presentation that addresses important access control, infrastructure, and management aspects from each location.

Answers


Te chequen casa para ver en su mouse hombre de doble

An if statement must always begin with the word “if.” True False python

Answers

Answer:

true

Explanation:

The given statement is true, that an if statement must always begin with the word “if.” in python.

What is the python?

A high-level, all-purpose programming language is Python. Code readability is prioritized in its design philosophy, which makes heavy use of indentation. Python uses garbage collection and has dynamic typing.

It supports a variety of paradigms for programming, including functional, object-oriented, and structured programming. An “if” statement must always be the first word in a sentence.

One of the most often used conditional statements in computer languages is the if statement in Python. It determines whether or not particular statements must be performed. It verifies a specified condition; if it is true, the set of code included within the “if” block will be run; if not, it will not.

Therefore, it is true.

Learn more about the python, refer to:

https://brainly.com/question/18502436

#SPJ2

Please help ASAP!
Combined with a set number of steps to determine size, what number of degrees would you use for turn degrees to command a sprite to trace a triangle with three equal sides?

A. 90, 90

B. 45, 45

C. 90, 180

D. 120, 120

Answers

Answer:

GIVE this man Brainliest!

Explanation:

How many components of a computer? ​

Answers

Answer:

There are five main hardware components in a computer system: Input, Processing, Storage, Output and Communication devices. Are devices used for entering data or instructions to the central processing unit.

Explanation:

3. Create tables CheckingAccount(CheckingAccountNumber, CustomerName, Balance, CustomerID), SavingsAccount(SavingsAccountNumber, CustomerName, Balance, InterestRate, CustomerID), Transactions(TransactionNumber, TransactionAmount, TransactionType, TransactionTime, TransactionDate, FromAccount, ToAccount, CustomerID). Use varchar(50) for any non-numerical value including AccountNumber and TransactionNumber, and float for any numerical value. CustomerID here means Username.

Answers

Answer:

Your answer is B

She forgot to record a transaction.

Explanation:

Edge 20 it’s right

What is the action take to the input called?

Answers

Answer:

Control types created with INPUT; Examples of forms containing INPUT controls ... The scope of the name attribute for a control within a FORM element is the FORM element. ... Applications should use the id attribute to identify elements. ... The program that will handle the completed and submitted form (the action attribute).

Explanation:

Create a list called numbers containing the values from 1 through 15, then use slices to perform the following operations consecutively: a. Select number’s even integers. b. Replace the elements at indices 5 through 9 with 0s, then show the resulting list. c. Keep only the first five elements, then show the resulting list. d. Delete all the remaining elements by assigning to a slice. Show the resulting list.

Answers

Answer:

Kindly check explanation

Explanation:

From python :

List containing values from 1 through 15:

my_list = list(range(1,16))

#creates a list of values from 1 to 15,(16 is excluded)

B.) select even integers :

for digits in my_list :

if digit%2 == 0;

print(digit)

# prints numbers in the list which does not leave a remainder when divided by .

C.)

for digits in my_list[4,9]:

my_digit[digits] = 0

my_digits

#Replaces the elements at indices 5 through 9 with 0s, then show the resulting list.

D.)

my_digits[:5]

#selects digits with index 0 up to 4

E.)

del my_digits[:5]

#DELETE elements in my digits starting from the fifth index

why use a chart legend?

Answers

Answer:

A legend or key helps the user build the necessary associations to make sense of the chart.

Explanation:

Legends summarize the distinguishing visual properties such as colors or texture used in the visualization.

What Is an Antivirus?

Answers

Antivirus software, or anti-virus software, also known as anti-malware, is a computer program used to prevent, detect, and remove malware. Antivirus software was originally developed to detect and remove computer viruses, hence the name.

Answer:

Antivirus software is a type of program designed and developed to protect computers from malware like viruses, computer worms, spyware, botnets, rootkits, keyloggers and such. Antivirus programs function to scan, detect and remove viruses from your computer.

Explanation:

write asswmbly prgram and do the following:
You have two numbers, the first one is 32 bits and the second is a 16 bits number. Find the result of division and store it in memory location called RESULT then store the reminder of division in memory location called MOD. (Use MACRO) ​

Answers

Answer:

I did this last year :/ i feel your pain.

Explanation:

You wrote a program to allow the user to guess a number. Complete the code to give the user feedback.

:
# Tell the user the guess was correct.
print("You were correct!")
keepGoing = False
else:
print("You were wrong.")

Answers

Answer:

The complete program is:

import random

keepGoing = True

num = random.randint(0,9)  

guess = int(input("Your guess: "))

while keepGoing == True:

   if num == guess:

       print("You were correct!")

       keepGoing = False

   else:

       print("You were wrong.")

       guess = int(input("Your guess: "))

       keepGoing = True

Explanation:

To answer this program, I let the computer generate a random number, then let the user make a guess.

This imports the random module

import random

This initializes a Boolean variable keepGoing to True

keepGoing = True

Generate a random number

num = random.randint(0,9)  

Let the user take a guess

guess = int(input("Your guess: "))

The loop is repeated until the user guesses right

while keepGoing == True:

Compare user input to the random number

   if num == guess:

If they are the same, then the user guessed right

       print("You were correct!")

Update keepGoing to False

       keepGoing = False

If otherwise,

   else:

then the user guessed wrong

       print("You were wrong.")

Prompt the user for another number

       guess = int(input("Your guess: "))

Update keepGoing to True

       keepGoing = True

Answer:

Complete the code below, which is an alternative way to give the user the same hints.

    if guess == correct:

       # Tell the user the guess was correct.

       print("You were correct!")

       keepGoing = False

   

elif guess < correct

:

       print("Guess higher.")

   

else

:

       print("Guess lower.")

Explanation:

Edge 2021

3.5 code practice question 1

Answers

Answer:

what is this a question or just saying something?

Explanation:

Answer:

uh what?

Explanation:

You are asked to design a data model for The Wagging Tail, an online store that sells products for dogs, e.g. dog collars, dog food, dog toys, dog treats, etc. You want to keep track of three entities: (1) the products that the store sells, (2) customers who purchase the products, and (3) the orders that are made on the website.
Draw an ERD diagram and use the following information to help guide your drawing:
The database should keep track of all products that the store offers for sale
The database should keep track of all customers who have registered with the store website
The database should keep track of all orders placed on the website
At most only a single customer can be related to any single order
A customer can place multiple orders with the website Each entity must have a unique identifier within its table. This is the Entity's/table's Primary Key.
An order must consist of at least one product, and may consist of multiple products
You wish to keep track of the cost of the product to the store, and the price that the store sells a product to the customer
You wish to be able to contact customers via phone and email
You wish to be able to determine when is the busiest time of year for your website according to number of orders placed
Your drawing should include the following: 1. The entities you wish to model 2. The required/important attributes for each entity (refer to these instructions for guidance on what is required/important) 3. The relationships between the entities 4. The correct MAX and MIN Cardinalities for each relationship (remember for each relationship, or line, there are MAX/MIN cardinalities on each side of the relationship)

Answers

Answer:

The solution to this question can be defined as follows:

Explanation:

In this question the Primary Key as defined in the underlines that use the Crow's foot notation which is defined in the 3 entities that can be defined in the attachment file:

Write a program which asks the user for their name and age. The program should then print a sentence.

What is your name?
Cory
What is your age?
48
Cory is 48 years old.

Answers

Answer:

name = input("What is your name? ")

age = int(input("What is your age? "))

print("%s is %d years old."% (name, age))

Explanation:

This is a solution in python.

If a program has no syntax errors, can we assume that it is secure? Why or why not?

Answers

Answer:

We cannot say it is secure until it has gone through security testing.

Explanation:

Syntax errors are caused by errors that occur in the source code. Some of these errors are caused by spellings and punctuation. If the code does not follow the syntax of the programming language that it is being written, it would likely display a syntax error.

A program is secure only when it has gone through security testing and found to be protected from vulnerabilities and attacks.

What is the best Describe an integer data type

Answers

Answer:

It is a data type that only holds whole numbers, a.k.a. integers.

what is the picture about?

Describing Lawyer Tasks
According to the video, which tasks do Lawyers commonly perform? Check all that apply.
O drawing up legal documents
guarding prisoners
O inspecting facilities for safety
trying cases in courts of law
O arresting criminals
counseling clients

Answers

Answer:

Explanation:

The answers are a, d, and f

Answer:

A, D ,F G

Explanation:

What are to be considered before software installation? Why?​

Answers

Answer:

before software installation we should consider the following things:

1. Software must be virus free

2.Required components for software should be installed

3.Computer requirements must be little bit high required for that software

4.software musn't be corrupt

Write a function named find_median that takes as a parameter a list of numbers. The function should return the median of those numbers, which will require it to sort the list. If you're not familiar with calculating the median, please look that up. Remember that the calculation is different for odd and even groups of values. For example, it could be used like this: some_nums

Answers

Quién es de Chicken #chequen Castro reverente de meados

The middle value in a data collection is returned by the median function in Microsoft Excel, which measures central tendency.

What is the main role of median function?

The number in the middle, with the same number below and above it, when there are an odd number of integers, is the median value.

The quantity of numbers in the data set affects the median result. The median is the value located in the center of the sorted dataset for an odd collection of numbers.

Excel's statistical functions include the MEDIAN Function. The middle value of the given collection of numbers will be determined by the function. The middle number in a collection of numbers is known as the median.

Therefore, If the list contains an even number of integers, the middle pair must be found, added, then divided by two to produce the median value.

Learn more about Median Function here:

https://brainly.com/question/16892747

#SPJ2

Directions Interview your parent or any member of your family. Identity
v. Performance Tasks
sources of your family income. Classify the types of your family
income if it is Money Income, Real Oncome or Psychic income​

Answers

Answer:

Total family income is first classified by it's four major source, earings of a male head , earings of a wife or female head , earings of a family members , and property or transfer income.

NO THIS ISNT ANY HOMEWORK!

Does anyone know a laptop under $200 that can run Minecraft Java edition and maybe 60fps?


PLEASE NAME A SPECIFIC ONE not to be rude but please don’t waste my time!



Sorry if I’m asking for too much we’re gonna travel soon and it’s gonna be for long months and I can’t bring my entire set up but I also don’t have much money and I can’t find any laptop like that so if you can help? Thank you!

Answers

Answer:

Name CPU, GPU & RAM My Rating (Out of 10)

HP Pavilion 15 Intel Core i7-8565U Nvidia MX 250 16GB 8.1

Asus VivoBook S15 Intel Core i5-8265U Nvidia MX250 8GB 7.8

Dell Inspiron 15 Intel Core i5-8250U Intel HD Graphics 16GB 7.6

Acer Aspire 5 Intel Core i5-8265U Nvidia MX250 8GB 7.5

Explanation:

I dont know the prices, I just searched it, though I will look into it more

Answer:

dont know the price but my mom bought me a macbook pro 13 inch and it works great !

Explanation:

edit: oop lol its like 1200 dollars

Other Questions
!!HELP ME!! ITS ECONOMICS!!!What does the business cycle shown on this graph suggest about the condition of the economy at point C?A. The economy is in a period of growth that will continue for some time.B. The economy has struggled for some time but is preparing to recover. C. The economy has done well for a while and is at its highest point of the cycle. D. The economy is getting worse and will continue declining for another quarter. What are the important of population growth Help asap, answer the question 1 by 1 I need help A right prism has volume 3645 and bases that are regular hexagons with sides of length 9. Find the height of the prism. Write a rational function for the given scenario. There may be more than one correct answer.Question 1. X-intercept: noneVertical Asymptote: X = -3Horizontal Asymptote: y = 0Question 2. X-intercept: noneVertical Asymptote X=2 & x= -2Horizontal Asymptote: y = 0Question 3 x-intercept: (3,0) & (-3,0) Vertical Asymptote: X=-1 & x= -4Horizontal Asymptote: y = 1Question 4. X-intercept: (-2, 0)Vertical Asymptote: X = 4 & x=-5 Horizontal Asymptote: y=0Need to make a rational function for each question. (23,9) and (-32, 14) True or FalseThe bill of rights is a formal listing of the basic rights of citizens of the united states. I need help plssssss Your friend's house is 9 miles south and 12 miles west of your school. How far is your friend's house from your school? -6x+5y=8 2x-4y=2 i need a x,y answer and i need some steps too The quote, Roosevelt always referred to Curry as "straight as a string," points out what about Currys disposition? -4X 1 > 1State all integer Values of x in the interval [-2,5] that satisfy the following inequality Amoeba Sisters Video Select Recap: Mitosis vs. Meiosis ComparisonCould i get help with this? According to the article "Caring for Vets Should Be National Duty," how does the VA Mission Act affect the medical community?It makes it illegal for doctors to charge vets for treatments related to their military service.It helps recruit new doctors to the VA that specialize in treating PTSD and painkiller abuse.It creates programs to provide employment to veterans training in medical fields.It provides funds to raise the salaries of doctors who focus on treating vets. HELPPPPCamille wants to set up a hot chocolate stand to raise money. She spends $40 onhot chocolate and $0.25 for each paper cup. She uses the equation y=0.25x+40to keep track of her spending. If Camille has $60 in donations to spend, what isthe maximum number of paper cups she can buy? Plsss help plssssssss my school is hosting a survey and I cant answer the last two questions:What are you looking MOST forward to this semester? Why? --------------------------------------------------andWhat extracurricular activities do you participate in at school? Sports? Clubs? (because I don't participate in anything after school) 32 pages in 4 days = pages per day Alex can climb 8 feet in 30 seconds and can run 112 feet in 20 seconds. When you combine his climbing and running, how many inches would that be? How can you apply mathematical concepts in a natural disaster?