Write the following function without using the C++ string class or any functions in the standard library, including strlen(). You may use pointers, pointer arithmetic or array notation.Write the function lastOfAny().The function has two parameters (str1, str2), both pointers to the first character in a C-style string.You should be able to use literals for each argument.The function searches through str1, trying to find a match for any character inside str2.Return the index of the last character in str1 where this occurs.

Answers

Answer 1

Answer:

The function in C++ is as follows

int chkInd(string str1, string str2){    

int lenstr1=0;

while(str1[lenstr1] != '\0'){  lenstr1++;  }

int index = 0; int retIndex=0;

for(int i=lenstr1-1;i>=0; i--){

   while (str2[index] != '\0'){

       if (str1[i] == str2[index]){

           retIndex=1;

           break;         }

       else{   retIndex=0;      }

  index++;    }

  if (retIndex == 0){   return i;   }else{return -1;}}

}

Explanation:

This defines the function

int chkInd(string str1, string str2){    

First, the length of str1 is initialized to 0

int lenstr1=0;

The following loop then calculates the length of str1

while(str1[lenstr1] != '\0'){  lenstr1++;  }

This initializes the current index and the returned index to 0

int index = 0; int retIndex=0;

This iterates through str1

for(int i=lenstr1-1;i>=0; i--){

This loop is repeated while there are characters in str2

   while (str2[index] != '\0'){

If current element of str2 and str1 are the same

       if (str1[i] == str2[index]){

Set the returned index to 1

           retIndex=1;

Then exit the loop

           break;         }

If otherwise, set the returned index to 0

       else{   retIndex=0;      }

Increase index by 1

  index++;    }

This returns the calculated returned index; if no matching is found, it returns -1

  if (retIndex == 0){   return i;   }else{return -1;}}

}


Related Questions

Implement a class that simulates a traffic light. The next function advances the color in the usual way, from green to yellow to red, then again to green. Provide two constructors, of the public interface. Also supply a member function that yields the number of times that this traffic light has been red.

Answers

Answer:

Explanation:

The following is written in Java. It creates the trafficLight class which holds the currentLight string variable and a int count variable for the number of times the light has been red. It also contains two constructors one that takes the currentLight as a parameter and one that does not. Finally, it has the next() method which analyzes the currentLight status and changes it to the next light. Output can be seen in the attached picture below.

class Brainly

{

   public static void main(String[] args)

   {

       trafficLight traffic_light = new trafficLight();

       System.out.println("Current Light: " + traffic_light.currentLight);

       traffic_light.next();

       System.out.println("Current Light after change: " + traffic_light.currentLight);

       

   }

}

class trafficLight {

   String currentLight;

   int count = 0;

   public trafficLight(String currentLight) {

       this.currentLight = currentLight;

   }

   public trafficLight() {

       this.currentLight = "red";

       count++;

   }

   public void next() {

       if (this.currentLight == "green") {

           this.currentLight = "yellow";

       } else if (this.currentLight == "yellow") {

           this.currentLight = "red";

           count++;

       } else {

           this.currentLight = "green";

       }

   }

}

3. Comparing the Utopian and dystopian views of Technology according to Street (1992) which one in your view is more applicable to your society? Give at least three reasons for your answer.[15marks]

Answers

Answer:

Following are the explanation to the given question:

Explanation:

The impact of a social delay in the debate around this one is serious, real perceptions of technology. It higher employment brings a political use of new information technology to further fragmentation and anomaly amongst their representatives with the ability for the same technology. They explain this dichotomy in utopian or dystopian positions inside the following portion.

Perhaps the most important aspect of the utopia was its implicit idea that solutions to social problems are available technically. The technological effects on the community or populist forms of democratic engagement were defined often that is solutions.

Its claim from the group indicates that perhaps the Internet can promote political participation by enabling citizens to communicate easily across geographic and social frontiers. The claim suggests that this exchange would in turn promote the creation of new consultative spaces or new modes of collective activity. By comparison, the authoritarian model emphasizes the role of technology in transforming citizens' and policy interactions. Ward (1997) states which online referenda and proposals are typically described as mechanisms of change.

Nothing less prevalent today are futuristic internet interpretations. Privacy as well as material on the Internet was a topic of genuine responsibility and formed two of the biggest discussions on the possible negative effects of this technology. Cyber-tumblers' tales and facts about oneself are prevalent across the web. Online entertainment questions confront Web users from all segments of society. Online entertainment questions

I assume that technology's Dystopian perspectives are relevant to society.

Even though people from every side of the issue claim that this technology would have a utopian or dystopian effect on business or community, society will be adapted to cultural underperformers and much more rational interpretations become. The demands for the impact on society were less severe when society had used technology capabilities, such as phones, television, and even phone line.If they regard the web and all its technological trappings as just a panacea for democracy problems or not, that truth about the capabilities of the internet lies between these utopian or dystopian definitions, like most of the truth.To grasp this technology which is practically transforming society, we have to consider its extreme impact as goods that are culturally incomplete between social diffusion of the Web and digital adoption of technology.

Write the difference between left-sentential form and
right-sentential form

Answers

Answer:

answer is below

Explanation:

A left-sentential form is a sentential form that occurs in the leftmost derivation of some sentence. A right-sentential form is a sentential form that occurs in the rightmost derivation of some sentence.

Specify the correct order of steps necessary to use RDMA over converged Ethernet in Windows Server 2016.

Answers

Answer and Explanation:

RDM has two modes as physical and virtual and depends on the virtualization such as Physical RDM and Virtual DRM Physical RDM expose the SCSI device with the VM and get virtualized as SCSI command go direct the OS. VM takes the lower-level features of the SCSI device. Physical RDM has the following scenarios as Run the management agents Cost-effective to physical clustering Virtual RDM underlying the physical properties and appear as same as Disk file on VMFS volume. The device appears as virtualization and reads and writes the raw LUN. RDM includes the OS file locking and user-friendly names. RDMs with the attacked device and redundant of the independent disk. RDM uses a serial number to identify the SCSI device. SAN has compatibility mode and manages the storage and mirroring operations. Virtualization is a tool that can minimize administrative overhead while increasing scalability and cost. RDM provides the benefits which should be used in every situation. Virtual disk files are preferable to RDMs and provide a user-friendly name for the mapped device.

First Step :

Introduction to deployment guide

Step 2:

Test Basic Connectivity

Step 3 :

Configure VLAN

Step 4:

Configure DCB

Step 5:

RDMA cooenctivity

Step 6

Switch creation and testing

Step 7

Enabling SR IOV for guest RDMA

Implement in a programming language of your choice the void function swap( a, b ) that exchanges the values of 2 passed actual int parameters a and b. State which language you select. Actual parameters a and b are 2 distinct addressable programming objects (variables).

Answers

Answer:

Javascript.

function swap(a, b) {

a = b;

b = a;

// can you explain more, aka for what to return

}

Explanation:

Imagine that you decided to film a video in SD because the video will mostly be shared on social mediaand you want it to be able to load quickly. What considerations do you need to take into account in order to make the video successful?

Answers

The considerations do you need to take into account in order to make the video successful are:

Select your video types.Decide on the platform(s) to us in sharing the video.Use prominent faces or celebrities on the video, etc.

How do one make a  video successful?

This can be done by:

Create goals for video marketingPlan content productionKnow the post-production detailsSchedule and also promote the videosKnow  and analyze metrics

Therefore, The considerations do you need to take into account in order to make the video successful are:

Select your video types.Decide on the platform(s) to us in sharing the video.Use prominent faces or celebrities on the video, etc.

Learn more about social media from

https://brainly.com/question/3653791

#SPJ1

The following truth table matches which boolean condition?
A B ?
1 1 1
1 0 1
0 1 0
0 0 1
A && ( A || B)
A || ( !A && !B)
A && ( A && B)
!A && ( A || !B)
A || ( A || B)
Consider the following class:
public class Thingy implements Comparable {
private int val;
public Thingy() {
this(0);
}
public Thingy(int t) {
val = t;
}
}
Which of the following methods must be included so this class can be instantiated?
a. compareTo
b. equals
c. indexOf
d. size
e. toString
Assume that x and y are boolean variables and have been properly initialized.
(x || y) && !(x && y)
The result of evaluating the expression above is best described as:_____.
A. Always true
B. Always false
C. True only when x is true and y is true
D. True only when x and y have the same value
E. True only when x and y have different values
You have created the following set of classes: Bus, Car, Scooter, Train, and Vehicle. Which would you choose to be the abstract class?
A. Bus
B. Car
C. Scooter
D. Train
E. Vehicle
Consider the method definition:
public static String analyzeTemps(int temps [], int avg) {
int above = 0;
int below = 0;
for(int i =0; i < temps.length; i++) {
if (temps[i] > avg)
above++;
if (temps[i] < avg)
below++;
}
if (above > below)
return "Hotter than normal";
if (above < below)
return "Cooler than normal";
return "Temperatures normal";
}
What is returned by the following?
int temps [] = {82 , 73 , 77 , 79 , 86 , 88 , 76 , 78 , 83};
System.out.println(analyzeTemps(temps, 81));
4
5
Cooler than normal
Hotter than normal
Temperatures normal
Consider the following code:
int list [] = /* missing code */;
int val = /* missing code */;
int n = -1;
for (int i = 0; i < list.length; i++) {
if (val == list[i]) {
n = i;
break;
}
}
What algorithm is shown?
A. Binary Search
B. Insertion Sort
C. Merge Sort
D. Selection Sort
E. Sequential Search
Suppose a child class has overridden a method of its parent class. What key word does the child class use to access the method in the parent class?
a. child
b. parent
c. static
d. super
e. this
What two methods from Object are often overridden?
a. add, compareTo
b. add, remove
c. toString, add
d. toString, equals
e. toString, compareTo
Consider the following class:
public class FrozenDesert{
public FrozenDesert() {
System.out.println("Yum");
}
}
You write a class, FrozenYogurt, which extends FrozenDesert. Which of the following is a correct implementation of the constructor for FrozenYogurt?
I. public FrozenYogurt() {
System.out.println("I'm the new ice cream");
super();
}
II. public FrozenYogurt() {
super();
System.out.println("I'm the new ice cream");
super();
}
III. public FrozenYogurt() {
super();
System.out.println("I'm the new ice cream");
}
a. I only
b. II only
c. III only
d. I and II
e. I, II and III
The constant in the Integer wrapper class that represents the smallest int value is ______.
A. MIN
B. MIN_VALUE
C. SMALL_INT
D. SIZE
E. Integer.MAX

Answers

Answer:

1 a

2 c

3 a

4 a

5c

6 b

7 a

8 c

Explanation:

The mass percent of hydrogen in CH₄O is 12.5%.Mass percent is the mass of the element divided by the mass of the compound or solute.

What is the mass percent?

Mass percent is the mass of the element divided by the mass of the compound or solute.

Step 1: Calculate the mass of the compound.

mCH₄O = 1 mC + 4 mH + 1 mO = 1 (12.01 amu) + 4 (1.00 amu) + 1 (16.00 amu) = 32.01 amu

Step 2: Calculate the mass of hydrogen in the compound.

mH in mCH₄O = 4 mH = 4 (1.00 amu) = 4.00 amu

Step 3: Calculate the mass percent of hydrogen in the compound.

%H = (mH in mCH₄O / mCH₄O) × 100%

%H = 4.00 amu / 32.01 amu × 100% = 12.5%

The mass percent of hydrogen in CH₄O is 12.5%.

CO2 = 1.580 grams H2O = 0.592 grams Lookup the molar mass of each element in the compound Carbon = 12.0107 Hydrogen = 1.00794 Oxygen = 15.999 Calculate the molar mass of CH4O by adding the total masses of each element used. 12.0107 + 4 * 1.00794 + 15.999 = 32.04146 Now calculate how many moles of CH4O you have by dividing by the molar mass. m = 1.15 g / 32.04146 g/mole = 0.035891 mole Now figure out how many moles of carbon and hydrogen you have. Carbon = 0.035891 moles Hydrogen = 0.035891 moles *

Therefore, The mass percent of hydrogen in CH₄O is 12.5%.

Learn more about mass percent here:

https://brainly.com/question/5295222

#SPJ5

Which one is the answer for the question.

Answers

Answer:

if/else statement

Explanation:

If the condition specified in the if statement is true, the block of code at the if statement is run. If not, the code at the else statement is run.

Consider the following statements. An abstract class is better than an interface when the variables in the abstract class or interface are likely to have changing values. An interface is better than an abstract class when nearly all of the methods in the abstract class or interface are abstract. An abstract class is better than an interface if new methods are likely to be required in the abstract class or interface in the future. An abstract class is better than an interface if a sub class is likely to need to inherit more than one super class. Which of the choices below is correct?

a. I and Il are true
b. I and III are true
c. II and III are true
d. I, II, and III are true
e. I, III, and I are true

Answers

Well the nonchalant question given for 4th grade red named babyface Justin and Jerome

Your disaster recovery plan calls for tape backups stored at a different location. The location is a safe deposit box at the local bank. Because of this, the disaster recovery plan specifies that you choose a method that uses the fewest tapes, but also allows you to quickly back up and restore files. Which backup strategy would best meet the disaster recovery plan for tape backups?

Answers

☞ANSWER☜

Store Physical Backup Media Offsite. Like data stored in the cloud, offline data stored on physical media is susceptible to unauthorized access. Offsite media storage helps significantly reduce the possibility of theft and physical damage to your media assets from fires, floods and natural disasters.

An incremental backup is one in which successive copies of the data contain only the portion that has changed since the preceding backup copy was made. ... Incremental backups are often desirable as they reduce storage space usage, and are quicker to perform than differential backups.

Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them

Answers

Answer:

? Read on to learn about the possible reasons and resolutions. ... Check whether you have the latest update installed for InDesign. ... InDesign cannot open the file when your system does not have enough memory ... Copy page elements into a new document.

Explanation:

ik its a dead game but who wants to play agar.io with me? the code is agar.io/#UMDX3A and my name on there is cohen

Answers

Answer:

I git banned lol

Explanation:

write a flow chart for lcm and its algorithim​

Answers

Answer: flowchart linked as an image

Explanation:

Using a loop and indexed addressing, write code that rotates the members of a 32-bit integer array forward one position. The value at the end of the array must wrap around to the ?rst position. For example, the array [10,20,30,40] would be transformed into [40,10,20,30].

Answers

Answer:

//begin class definition

public class Rotator{

    //main method to execute the program

    public static void main(String []args){

       

       //create and initialize an array with hypothetical values

       int [] arr =  {10, 20, 30, 40};

       

       //create a new array that will hold the rotated values

       //it should have the same length as the original array

       int [] new_arr = new int[arr.length];

       

       

       //loop through the original array up until the

       //penultimate value which is given by 'arr.length - 1'

      for(int i = 0; i < arr.length - 1; i++ ){

           //at each cycle, put the element of the

           //original array into the new array

           //one index higher than its index in the

           //original array.

          new_arr[i + 1] = arr[i];

       }

       

       //Now put the last element of the original array

       //into the zeroth index of the new array

       new_arr[0] = arr[arr.length - 1];

       

       

       //print out the new array in a nice format

      System.out.print("[ ");

       for(int j = 0; j < new_arr.length;  j++){

           System.out.print(new_arr[j] + " ");

       }

       System.out.print("]");

       

    }

   

   

}

Sample Output:

[ 40 10 20 30 ]

Explanation:

The code above is written in Java. It contains comments explaining important parts of the code.  A sample output has also been provided.

The World Health Organization decided that addiction to video games is considered a mental health disorder. Do you agree or disagree?

What responsibility, if any, do game designers have to ensure that users do not misuse their games?

(I’m mainly looking for an answer to the second bit, thank you! ^^)

Answers

Answer:

I disagree and I will tell you why because there was study based on video games and seniors and the theory was that they play games to keep there minds active. I will give you an example let's say you were in a situation and you learned how to make or create something from playing video games, in closeur video games can help us in problems

what is MIS when it refers to the dat base

Answers

A management information system (MIS) is a computerized database of financial information organized and programmed in such a way that it produces regular reports on operations for every level of management in a company. It is usually also possible to obtain special reports from the system easily.

Answer: A management information system (MIS) is a computerized database of financial information organized and programmed in such a way that it produces regular reports on operations for every level of management in a company. It is usually also possible to obtain special reports from the system easily.

HOPE THIS HELPS

Write multiple if statements. If car_year is 1969 or earlier, print "Few safety features." If 1970 or later, print "Probably has seat belts." If 1990 or later, print "Probably has antilock brakes." If 2000 or later, print "Probably has airbags." End each phrase with a period and a newline.

Sample output for input: 1995
Probably has seat belts.
Probably has antilock brakes.

My code:

car_year = int(input())

if car_year <= 1969:
print('Few safety features.')
elif car_year ==1970:
print('Probably has seat belts.')
elif car_year >= 1990:
print('Probably has seat belts.\nProbably has antilock brakes.')
else:
car_year >= 2000
print('Probably has airbags.')

My output that keeps failing:
Testing with input: 2001
Output differs. See highlights below.
Special character legend
Your output
Probably has seat belts.
Probably has antilock brakes.
Expected output
Probably has seat belts.
Probably has antilock brakes.
Probably has airbags.

Answers

Your problem is that you're using elif and if statements. As soon as one of your statements is true, the other ones don't run. You need to use multiple if statements instead of the elif and else statements. For instance:

car_year = int(input())

if car_year <= 1969:

   print('Few Safety features.')

if car_year >=1970:

   print('Probably has seat belts.')

if car_year >= 1990:

   print('Probably has antilock brakes.')

if car_year >= 2000:

   print('Probably has airbags.')

I wrote my code in python 3.8. I hope this helps.

Answer:

car_year = int(input())

if car_year <= 1969:

  print('Few safety features.')

if car_year >=1970:

  print('Probably has seat belts.')

if car_year >= 1990:

  print('Probably has antilock brakes.')

if car_year >= 2000:

  print('Probably has airbags.')

Explanation:

Just needed to change the capitol S on the previous code to a small s. Works just fine.  in Python.

Examine about the Internal & External Fragmentation methods give an example for each. essay​

Answers

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory. Internal Fragmentation occurs when Paging is employed. External Fragmentation occurs when Segmentation is employed.

Internal Fragmentation

A bigger chunk of RAM is set aside for the process. Some memory is left unused because it cannot be utilised by another function. By properly allocating the smallest division that is yet large enough for the process, internal fragmentation can be reduced.

When there is a mismatch between the quantity of memory needed and the amount of memory that is actually available, internal fragmentation becomes a problem.

When paging is used, internal fragmentation occurs.

When memory allocations are made but chunk sizes are fixed, internal fragmentation follows.

Internal process fragmentation occurs when a process consumes less memory or uses more than the allocated memory block can hold.

External Fragmentation

Although the total RAM is large enough to accommodate a process or handle a request, we are unable to use it since it is not contiguous. To lessen external fragmentation, we can condense or shuffle memory to free up a substantial amount of space. For compaction to be useful, relocation must be dynamic.

Internal fragmentation is largely controlled via Best Fit Block Search.

External fragmentation is fixed through compaction.

When the size of the allotted memory blocks fluctuates, external fragmentation occurs.

When segmentation is used, external fragmentation happens.

When small, non-contiguous memory blocks cannot be assigned to any process, external fragmentation results.

An affected process is deleted from the main memory as a result of external fragmentation.

A person wants to buy a house that cost $100,000 but she only has about 20,000 in her savings account she goes to a bank to see if they can help her the bank agrees to lend her enough money to buy the house but she has to pay the money back overtime. This situation best illustrates which function of money?

A. Measure of value
B.Medium of exchange
C.Standard of deferred payment
D.Store of value



Someone please help me ASAP.

Answers

Answer:

B

Explanation:

Since she is exchanging

What are the vitamins used for DNA Synthesis and Repair?​

Answers

Answer:

Vitamins C & E

Vitamin D

Vitamin B3

i don’t know what subject to put this question in but does anyone know the difference between a quarter grade and "fin" grade on skyward bc my current quarter grade is very different from my grade on fin and i don’t know what it means

Answers

What's skyward? Explain plz and i'll update the answer.

(a)
The computer network that covers the whole city is called​

Answers

Answer:

A metropolitan area network, or MAN, consists of a computer network across an entire city, college campus or small region. A MAN is larger than a LAN, which is typically limited to a single building or site. Depending on the configuration, this type of network can cover an area from several miles to tens of miles.

Explanation:

What is meant by a balanced budget?

A. inflows are greater than outflows

B. inflows are less than outflows

C. inflows are equal to income

D.inflows are greater than or equal to outflows.

Answers

Answer:

D.inflows are greater than or equal to outflows.

Explanation:

A budget is a financial plan used for the estimation of revenue and expenditures of an individual, organization or government for a specified period of time, often one year. Budgets are usually compiled, analyzed and re-evaluated on periodic basis.

A balanced budget is a type of budget in which inflows are greater than or equal to outflows. Thus, when cash inflows (income) is greater than or equal to cash outflows (expenses), a budget is said to be balanced.

The first step of the budgeting process is to prepare a list of each type of income and expense that will be integrated or infused into the budget.

This ultimately implies that, before preparing a budget, it is of utmost importance to know total income (inflows) and expenses (outflows).

The final step to be made by the management of an organization in the financial decision-making process is to make necessary adjustments to the budget.

In conclusion, the benefits of having a budget is that it aids in setting goals, earmarking revenues and resources, measuring outcomes and planning against contingencies. It is typically used by individuals, government, organizations or companies due to the fact that, it's tied directly to the strategy and tactics of a company on an annual basis. Also, it is used to set a budget for marketing efforts while anticipating on informations about the company.

Name the processes that the information processing cycle consist of:​

Answers

Answer:

Hello Dear!...

Explanation:

The information-processing cycle consists of four basic operations: input, processing, output, and storage.

Hope that helps you Buddy..

Buhbye!

Take care!

Why is it easier to spot a syntax error than a logical error?​

Answers

Answer:

Even small typos that do not produce syntax errors may cause logic errors. ... The logic error might only be noticed during runtime. Because logic errors are often hidden in the source code, they are typically harder to find and debug than syntax errors.Explanation:

Consider the following code segment, where num is an integer variable.int[][] arr = {{11, 13, 14 ,15},{12, 18, 17, 26},{13, 21, 26, 29},{14, 17, 22, 28}};for (int j = 0; j < arr.length; j++){for (int k = 0; k < arr[0].length; k++){if (arr[j][k] == num){System.out.print(j + k + arr[j][k] + " ");}}}What is printed when num has the value 14 ?
a. 14 14
b. 18 19
c. 16 17
d. 17 16
e. 19 181/1

Answers

Answer:

c. 16 17

Explanation:

Given

[tex]num = 14[/tex]

The above code segment

Required

The output

In the code segment, we have the following iterations:

for (int j = 0; j < arr.length; j++) and for (int k = 0; k < arr[0].length; k++)

The above iterates through all the elements of the array.

The if condition is true, only on two occasions

(i) When i = 0; j = 2

(ii) When i = 3; j = 0

i.e.

arr[0][2] = 14

arr[3[0] = 14

So, the result of the print statement is: j + k + arr[j][k]

(i) When i = 0; j = 2

j + k + arr[j][k]  = 0 + 2 + 14 = 16

(ii) When i = 3; j = 0

j + k + arr[j][k]  = 3 + 0 + 14 = 17

Hence, (c) 16 17 is true

Unemployment rate is a macroeconomic measure that describes:
O A. the percentage of people who are looking for a job but cannot find
one.
B. the value of the goods produced in a country divided by its
population.
c. the total value of goods and services a country produces in a year.
D. the increase in prices of consumer goods over a period of time.



Someone help me ASAP pleaseeee

Answers

Answer:

c

Explanation:

writer an obituary about macbeth​

Answers

Answer:

hi

Explanation:

Part 3 (The stunner)

Answers

Answer:

nice :)

Explanation:

Answer: Once again, levers where we cant see.

A cookie recipe calls for the following ingredients:
• 1.5 cups of sugar
• 1 cup of butter
• 2.75 cups of flour
The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies in the following format:

You need 5 cups of sugar, 3 cups of butter, and 7 cups of flour.

Note: Don’t worry about formatting the numbers in the output.

Answers

def cookie_Recipe(recipe):

   

   sugar=(0.03125*recipe)

   butter=(0.02083333333*recipe)

   flour=(0.05729166666*recipe)

   LF1=round(sugar, 2)

   LF2=round(butter,2)

   LF3=round(flour, 2)

   print("You will need:")

   print(LF1, "cups of sugar")

   print(LF2, "cups of butter")

   print(LF3, "cups of flour")

   print("To make", recipe, 'cookies')

recipe=int(input("How many cookies do you want to make?\n"))

cookie_Recipe(recipe)

The program is a sequential program and does not require loops, iterations, and conditions.

What is python?

Python is a general-purpose programming language.

The Python program that uses comments to clarify each line is as follows:

#This gets the number of cookies

cookies = float(input("Number of cookies: "))

#This calculates the amount of sugar

sugar = (1.5 * cookies) / 48.0

#This calculates the amount of butter

butter = cookies / 48

#This calculates the amount of flour

flour = (2.75 * cookies) / 48

#This prints the amount of sugar, butter and flour needed

print("You need ", format(sugar, '.2f'), " cups of sugar, ", format(butter, '.2f'), " cups of butter and ", format(flour, '.2f'), " cups of flour", sep='')

Therefore, the program is written above.

To learn more about python, refer to the link:

https://brainly.com/question/12867701

#SPJ2

Other Questions
On July 31, 2020, Vaughn Company had a cash balance per books of $6,132.05. The statement from Dakota State Bank on that date showed a balance of $7,748.15. A comparison of the bank statement with the Cash account revealed the following facts. 1. The bank service charge for July was $25. 2. The bank collected $1,720 for Keeds Company through electronic funds transfer. 3. The July 31 receipts of $1,297.50 were not included in the bank deposits for July. These receipts were deposited by the company in a night deposit vault on July 31. 4. Company check No. 2480 issued to L. Taylor, a creditor, for $391 that cleared the bank in July was incorrectly entered as a cash payment on July 10 for $319. 5. Checks outstanding on July 31 totaled $1,866.60. 6. On July 31, the bank statement showed an NSF charge of $576 for a check received by the company from W. Krueger, a customer, on account.Required:Prepare the bank reconciliation as of July 31. Find the missing side length,Assume that all intersecting sides meet at right angles.Be sure to include the correct unit in your answer5 cm8 cm11 cm16 cm 4cm Find the value of x. The answer is 7 I just need to show work :D Construct a SQL query that displays a list of colleges, their sity/state, the accrediting agency, and whether or not the school is distance only. Only show the first 10 records. ____ communication occurs when the downstream throughput is higher than the upstream throughput. in Lets pretend you were assigned a research paper for your history class. While searching for resources on the Internet you find two websites about your topic. One website is a personal blog. The other website has .gov at the end of its web address. Which website would be better to use for your research paper? Explain why.will give brainilist A wood-burning stove is used to heat the air in a small room.What types of heat transfer are involved? The customs duty on imported vehicles is 30% of the price paid by the importer.(a) Calculate the customs duty on a car for which the price paid by the importer is $8,500.(b) Calculate the price paid by the importer for a bus for which the amount is paid, including customs duty is $15,600 Is it a b c d need help SITUATION QUESTION: YOU ARE AWARE THAT TWO OR MORE MEMBERS OF YOURTEAM DO NOT GET ALONG AND ARE OPENLY HOSTILE TO EACH OTHER ATPRACTICE. AS THE LEADER OF THE GROUP, WHAT DO YOU THINK IS THEAPPROPRIATE COURSE OF ACTION? Balanced equation: K2S(aq) + BaCl2(aq) = How many grams of carbohydrates make up 7% of the recommended daily allowance?a. 16 b. 7c. 21d. 31 Civil rights movement? Where this movement took place original price: $32 discount: 16% sale price: ? Which property would most likely be the same when comparing two random samples of copper?A massO B. volumeOC weightOD. density The swimming pool is opened 8 hours a day the pool manager must divide pool time equally among 5 groups; camp, camp swim team, swim lessons, family swim, and open swim how much time should she allow for each group? hey! ill give brainliest please help. How 1D array can be initialized ( computer science) Last one for this :) Someone help I need answers Ill give brainliest and like the comment