You are tasked with creating a mileage calculator to calculate the amount of money that should be paid to employees. The mileage is computed as follows An amount of .25 for each mile up to 100 miles An amount of .15 for every mile above 100. So 115 miles would be (.25 * 100) + (.15 * 15) This can all be coded using a mathematical solution but I want you to use an if / else statement. Here is how you are to implement it: If the total miles input is less than or equal to 100 then simply calculate the miles * .25 and output the amount otherwise compute the total amount for all miles mathematically. Input: Total number of miles Process: dollar amount owed for miles driven Output: Amount of money due * Please note that you should simply do calculations within the if and else statements. This mean no cin or cout within if or else. Do it afterward.

Answers

Answer 1

Answer:

Desired C++ Program with proper comment is given below

Explanation:

#include<iostream>

using namespace std;

//main function

int main()

{

  int totalMiles = 0;

  int remainingMiles = 0;

  double amt = 0;

 

  //taking input from user regarind total miles

  cout<<"Enter the total miles: "<<endl;

  cin>>totalMiles;

  //if-else condition to do the calculation

  if(totalMiles<=100)

  {

      amt = totalMiles*.25;

  }

  else

  {

      remainingMiles = totalMiles - 100;

      amt = 100*.25 + remainingMiles*.15;      

  }

 

  cout<<"The total amount is: "<<amt<<endl;

}


Related Questions

g Returns the contents of the list as a new array, with elements in the same order they appear in the list. The length of the array produced must be the same as the size of the list.

Answers

Answer:

Find the attached picture

Explanation:

Attached picture contains the Python function which takes a list as argument and returns a new list with same size and elements in same order.

What steps should be followed to properly evaluate an organization’s future with online sales?

Answers

Answer:

Following step have mentioned to evaluate organization's future.

Explanation:

Evaluate organizational goals. The initial step is to identify the specific purposes for evaluation.

Target the customer profiles. It is essential to finding a series of well-constructed customer profiles. If you have no idea of your target customer, you should not launch your online sale.

Check the money you put into your marketing plan has some profit. Must measure the amount of the campaign.

Reading the primary way to determine the plan is working.

Customer response is essential for marketing reactions. Online surveys and customer feedback are crucial.    

Answer and explanation:

Online-sales dedicated companies have spread in number over the past years thanks to the easiness to access to the internet. For those organizations to keep their business up and running, they should take into consideration what other technologies factors are being developed that could help improve their operations or that could wipe out their businesses. It is also important to study consumers' trends because just like with face-to-face sales, they tend to change.

Write a program called interleave that accepts two ArrayLists of integers list1 and list2 as parameters and inserts the elements of list2 into list1 at alternating indexes. If the lists are of unequal length, the remaining elements of the longer list are left at the end of list1.

Answers

Answer:

Explanation code is given below along with step by step comments!

Explanation:

// first we create a function which accepts two ArrayList of integers named list1 and list2

public static void interleave(ArrayList<Integer> list1, ArrayList<Integer> list2)

{

// we compare the size of list1 and list2 to get the minimum of two and store it in variable n

   int n = Math.min(list1.size(), list2.size());

   int i;

// here we are getting the elements from list2 n times then we add those elements in the list1 alternating (2*i+1)

   for (i = 0; i < n; i++)

     {

       int x = list2.get(i);

       list1.add(2 * i + 1, x);

      }

// if the size of list1 and list2 is same then program stops here else we need to append extra elements at the end of list1

// then we check if the size of list2 is greater than list1 then simply add the remaining elements into list1

   if (i < list2.size())

{

       for (int j = i; j < list2.size(); j++)

           {

                list1.add(list2.get(j));

            }  

     }  

}

Sample Output:

list1=[1, 2, 3]

list2=[5, 6, 7, 8, 9]

list1=[1, 5, 2, 6, 3, 7, 8, 9]

write a java program that will print out the following pattern 1 12 123 1234 12345

Answers

Answer:

public class Main {

  public static void main(String[] args)

{

  int n,m;

  int k=5;

  for(n=1;n<=k;n++)

  {

for(m=1;m<=n;m++)

  System.out.print(m);

   System.out.print(" ");

   }

}

}

Explanation:

The solution to this problem is the use of nested loops of an inner and outer loop to generate a half pyramid of numbers, but displayed on the same line so we have a sequence 1 12 123 1234 12345. The outer loop iterates for n=1 to n<=5 and the inner loop that has the print statement prints the integers from for m = 1 to m<=n.

Note that the value k = 5 is hard coded which in some sense is the number of rows, that is the length of iteration of the outer loop.

If a computer is capable only of manipulating and storing integers, what difficulties present themselves? How are these difficulties overcome?

Answers

Final answer:

When a computer is only capable of manipulating integers, difficulties arise with decimal numbers. However, these difficulties can be overcome by using different data types and algorithms. Programming languages and libraries provide tools to handle decimal numbers accurately.

Explanation:

When a computer is only capable of manipulating and storing integers, difficulties arise when working with numbers that involve decimal points or fractions. This is because computers work with binary numbers, which only consist of the digits 0 and 1. Decimal numbers cannot be represented directly in binary notation.

However, these difficulties can be overcome by using different data types and algorithms. For example, floating-point numbers can be used to represent decimal numbers in a binary format. Algorithms can be developed to perform mathematical operations on these floating-point numbers, allowing computers to work with a wider range of numeric values.

Programming languages and libraries provide built-in functions and methods to handle decimal numbers and perform arithmetic operations accurately. By using these tools, computer programmers can effectively work with integers, as well as decimal numbers, without losing accuracy.

What common problems do a collection of spreadsheets created by end users share with the typical file system?

Answers

Answer:

Explanation:

A spreadsheet is an application software to administrate data and different information, while in a file system we could find assignment table like FAT and NTFS, for example, FAT (file allocation table) is similar because store the data in tables, these methods have other things in common like hard to develop, difficult to get an answer, complex administration, and poor security.

5. Write few lines of code that creates two arrays with malloc. Then write a statement that can create a memory leak. Discuss why you think your code has a memory leak by drawing the status of the memory after you use malloc and the line of the code you claim that creates a memory leak.

Answers

Answer:

 // function with memory leak  

void func_to_show_mem_leak()  {  

int *pointer;

pointer = malloc(10 * sizeof(int));

*(pointer+3) = 99;}  

 

// driver code  

int main()  

{  

    // Call the function  

   // to get the memory leak  

   func_to_show_mem_leak();  

     return 0;  }

Explanation:

Memory leakage occurs when programmers allocates memory by using new keyword and forgets to deallocate the memory by using delete() function or delete[] operator. One of the most memory leakage occurs by using wrong delete operator. The delete operator should be used to free a single allocated memory space, whereas the delete [] operator should be used to free an array of data values.

1. Write an LMC (Little Man Computer) program to do the following task. if (value == 0) { some_statements; } next_statement;
2. Write an LMC program to add three numbers. The numbers are provided in the in-basket. The sum of the numbers should appear in the out-basket.

Answers

Answer:

The program is given below with appropriate comments for better understanding

Explanation:

1) LMC Program:

LDA A //Load A

SUB B //Subtract from A, B which is 0.

SKZ // skip next statement if A-B == 0 , which is A == 0 as B is zero.

JMP ENDIF // jump to ENDIF point if A not equal to 0, else this step is skipped.

OUT // some statement , not called if A != 0.

ENDIF LDA A // jump statement arrives here if A != 0.

HLT //HALT

2) LMC Program:

//input first number  

INP

//store it at address 99

STA 99

//input second number

INP

//add it to value at 99

ADD 99

//store the resulting sum to 99

STA 99

//input third number

INP

//add the number to value at 99 address(which is the sum of first and second number)

ADD 99

//output sum

OUT

//halt

HLT

Which of the following would not be a probable reason for choosing simulation as a decision-making tool?

Answers

Answer:

The correct answer is letter "B": There is a limited time in which to obtain results .

Explanation:

Decision-making tools allow entrepreneurs to analyze their companies from different angles thanks to the information provided. Market research, decision matrix, cost-benefit analysis, T-Charts, or SWOT (Strengths, Weaknesses, Opportunities, and Threats) Analysis are helpful for that purpose.

If a simulation is needed before going with the analysis itself, the time it could take is not specific. In case the company has a close deadline to decide on a topic, managers should avoid simulations and go ahead with the analysis but a deep evaluation of the results must be carried out to confirm accuracy.

Write a function called swatch that takes three arguments:

1. A start color,
2. An end color
3. A number of squares to generate.

Answers

Answer:

def swatch (startColor, endColor, numOfSquares):

   '''

   documentation:

   A description of what this function does

   '''

   return

Explanation:

Using python programming language, we define the function called swatch and specify the parameters as required in the question. Functions are defined in python using the def keyword followed by the function's name then followed by the optional arguments list. The writing that appears between the '''    ''' is for the functions documentation, it provides a description of what the function does

Given the following function definition:
What is the output of the following code fragment that invokes calc?
1 2 3 1 6 3 3 6 3 1 14 9
None of these

Answers

The question is incomplete! Complete question along with its step by step answer is provided below!

Question:

Given the following function definition:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

What is the output of the following code fragment that invokes calc?

a. 1 2 3

b. 1 6 3

c. 3 6 3

d. 1 14 9

e. None of these

Answer:

b. 1 6 3

Explanation:

In the given problem we have a function void calc which takes two input arguments a and b and updates its values according to following equations

c = a + 2;

a = a * 3;

b = c + a;

Then we call this function calc(x,y) by providing test values of

int x = 1;

int y = 2;

int z = 3;

and the output returns the values of x, y and z

cout << x << " " << y << " " << z << endl;

Lets find out what is happening here!

When the program runs we provide x=a=1 and y=b=2

c=a+2=1+2=3

a=a*3=1*3=3

b=c+a=3+3=6

So the updated values of a=x=3 and b=y=6?

NO!

The updated values are a=x=1 and b=y=6

WHY?

There are two ways to pass values

1. Pass by values -> value cannot change  (int a)

2. Pass by reference -> value can change (int& b)

Look at the function void calc (int a, int& b) ;

Here we are passing (int a) as a value and (int& b) as a reference, therefore x remains same x=1 and y gets changed to updated value y=6 and z remains same as z=3 since it wasnt used by function calc(x,y)

The right answer is:

b. 1 6 3

x=1, y=6, z=3

Jonathan Simpson owns a construction company. One day a subcontractor calls him saying that he needs a replacement check for the job he completed at 1437 Elm Street. Jonathan looks up the job on his accounting program and agrees to reissue the check for $12,750. The subcontractor says that the original check was for only $10,750. Jonathan looks around the office and cannot find the company checkbook or ledger. Only one other person has access to the accounting program. Jonathan calls you to investigate. How would you proceed?

Answers

Answer:

I would tell to subcontractor that in this moment there is no ledger or some other person that could help me to check this out, also ill tell them that we will try to get this problem solved as soon as posible, but for now, we have  wait for assistance to verify the information and escalate properly the situation.

he data warehousing maturity model consists of six stages: prenatal, infant, child, teenager, adult, and sage. True False

Answers

Answer:

The correct answer to the following question will be "True".

Explanation:

The maturity model of data warehousing offers a route map for evaluating the success of an enterprise in building data warehouses to encourage intelligence in business and consists of six stages such as maternal, child, infant, juvenile, sage, and adult.This model gives instructions on moving between various phases that can inhibit efficient data warehouses usage.

Therefore, the given statement is true.

Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records associated to their Account or Contact record. The Architect is planning to use a Sharing Set to provide access to the records. When setting up the Sharing Set, certain objects are not available in the list of Available objects.Which two reasons explain why an object is excluded from the list of Available objects in a Sharing Set?Choose 2 answers
A. The custom object does not have a lookup to Accounts or ContactsB. The object’s Organization-Wide sharing setting is set to PrivateC. The object’s Organization-Wide setting is set to Public Read/WriteD. The object is a custom object, and therefore not available for a sharing set

Answers

Answer:

The answers are A and C

Explanation:

The reason the objects were excluded from the list of available objects are as follows:

A.) The custom object does not have a lookup to Accounts or Contacts

C.) The object's Organization-Wide sharing setting is set to Public Read/Write.

If you want to write some fancy interface on your computer with expanded communication to the Arduino, what library should you use?

Answers

Answer:

The correct answer is letter "C": Java.

Explanation:

Arduino is a developmental free software and hardware organization that provides an electronic prototyping platform that allows users to create electronic objects. To write interfaces with expanded communication in the software, the java library must be used with that purpose to fasten the interface functions. Many java libraries can be used such as java.io, java.lang, java.awt or java.util.

Write an if-else statement for the following:

If userTickets is less than 6, execute awardPoints = 1.
Else, execute awardPoints = userTickets.
Ex: If userTickets is 3, then awardPoints = 1.

Answers

Answer:

if(userTickets< 6)

awardPoints = 1;

else

awardPoints = userTickets;

Explanation:

The above code is in C language, In which the first statement is used to compare the userTickets value by 6 that userTickets value is less than 6 or not.If the user tickets value is less than 6 then the statement of 'if' condition will be executed which assign the 1 value to the awardPoints.If the user tickets value is not less than 6 then the statement of else will be executed which assign userTickets value to the awardPoint

The  if-else statement for the following code is :

x = 6

userTickets = 3

if x < 6:

  awardPoints = 1

  print(awardPoints)

else:

  awardPoints = userTickets

  print(awardPoints)

The code is written in python.

Code explanation:The variable x is initialise to 6The variable userTickets is also initialise to 3.Using the if statement, we check if x is less than 6.If it is less than 6, awardPoints is equals to 1 and it is printed out.Else awardPoints is equals to the userTickets and then it is outputted using the print statement.  

learn more on if-else statement here: https://brainly.com/question/25302477?referrer=searchResults

Which statement is true regarding security for a computer that boots to Apple Mac OS X and then runs a Windows virtual machine

Answers

Answer:

The correct answer to the following question will be "Virtual windows PC needs the security of its own".

Explanation:

Using Parallels Desktop, Virtual box or the VMware Fusion to run Windows on a VM (virtual machine) inside the macOS. This technique allows the simultaneous running of Windows and mac programs, although the virtual machine doesn't quite accept as many Windows features as a double-boot configuration.

Therefore, this will be the right answer.

You would like to create a dictionary that maps some 2-dimensional points to their associated names. As a first attempt, you write the following code:

points_to_names = {[0, 0]: "home", [1, 2]: "school", [-1, 1]: "market"}

However, this results in a type error.
Describe what the problem is, and propose a solution.

Answers

Answer:

A dictionary is a "key - value" pair data structure type. The syntax for creating a dictionary requires that the keys come first, before the values.

This problem in the question above is as a result of you interchanging the keys and values. THE KEYS MUST COME FIRST BEFORE THE VALUES

Explanation:

To solve this problem you will need to rearrange the code this way

points_to_names = {"home":[0, 0] , "school":[1, 2], "market":[-1, 1] }

See the attached code output that displays the dictionary's keys and values

In the center pane of the __________, the direction of each arrow indicates the direction of the TCP traffic, and the length of the arrow indicates between which two addresses the interaction is taking place.

Answers

Answer:

The answer is "Result of Flow Graph Analysis".

Explanation:

A flow chart is also known as a graphical representation of any task. It a graphing program, which collects data, checks its control flows and provides abstracts from program details.

It produces a decision chart in the paper, which reduces the control flow chart but keeps the program branching structure. It also used to manage to troubleshoot network issues.

(TCO 1) You want to find the IP address of an interface. How can you quickly do this?

Answers

Answer:

Ping the interface using the cmd or terminal

Explanation:

Write a program that allows the user to enter an integer value n and prints all the positive even integers smaller or equal to n, in decreasing order.

Answers

Answer: Following code is in python

n=int(input("Enter integer "))   //taking n as an input

if n%2==0:   //if divisible  by 2

   for i in range(n,0,-2):   //n will be included

       print(i)

else:

   for i in range(n-1,0,-2):   //else n won't be included

       print(i)

OUTPUT :

Enter integer 26

26

24

22

20

18

16

14

12

10

8

6

4

2

Explanation:

An input is taken and converted to int type as the input is of string type in python. It is checked if a number is divisible by 2 as if it is, then number is included because it is an even number and range() method is used which takes 3 numbers as parameters - start, end and step. If the step is -2 then 2 is subtracted every time from n. n is not included if it is not an even number.

Write a function that computes the average and standard deviation of four scores. The standard deviation is defined to be the square root of the average of the four values: (si − a )2, where a is the average of the four scores s1, s2, s3, and s4. The function will have six parameters and will call two other functions. Embed the function in a program that allows you to test the function again and again until you tell the program you are finished.

Answers

Answer:

#include<iostream>

#include<cmath>

using namespace std;

double calAvg(double s1, double s2,double s3, double s4);

double calStandardDeviation(double s1, double s2,double s3, double s4,double average,int n);

void main()

{

 double s1,s2,s3,s4;

double avg,StandardDeviation;

char option;

   do

{

 cout<<"Enter s1:";

 cin>>s1;

 cout<<"Enter s2:";

 cin>>s2;

 cout<<"Enter s3:";

 cin>>s3;

        cout<<"Enter s4:";

 cin>>s4;

 avg=calcAvg(s1,s2,s3,s4);

        sdeviation=calcStandardDeviation(s1,s2,s3,s4,avg,4);

 cout<<"Standard deviation:"<<sdeviation<<endl;

 cout<<"Do you want to continue then press y:";

         cin>>option;

}

       while (option='y');

}

double Average(double s1, double s2,double s3, double s4)

{

return (s1+s2+s3+s4)/4;

}

double calcStandardDeviation(double s1, double s2,double s3, double s4, double mean,int n)

{

double sd;

sd=(pow((s1-mean),2)+pow((s2-mean),2)+

                     pow((s3-mean),2)+pow((s4-mean),2))/n;

sd=sqrt(sd);

return sd;

}

In this exercise we have to use the knowledge in computer language to write a code in C, like this:

the code can be found in the attached image

to make it simpler we have that the code will be given by:

#include<iostream>

#include<cmath>

using namespace std;

double calAvg(double s1, double s2,double s3, double s4);

double calStandardDeviation(double s1, double s2,double s3, double s4,double average,int n);

void main()

{

double s1,s2,s3,s4;

double avg,StandardDeviation;

char option;

  do

{

cout<<"Enter s1:";

cin>>s1;

cout<<"Enter s2:";

cin>>s2;

cout<<"Enter s3:";

cin>>s3;

       cout<<"Enter s4:";

cin>>s4;

avg=calcAvg(s1,s2,s3,s4);

       sdeviation=calcStandardDeviation(s1,s2,s3,s4,avg,4);

cout<<"Standard deviation:"<<sdeviation<<endl;

cout<<"Do you want to continue then press y:";

        cin>>option;

}

      while (option='y');

}

double Average(double s1, double s2,double s3, double s4)

{

return (s1+s2+s3+s4)/4;

}

double calcStandardDeviation(double s1, double s2,double s3, double s4, double mean,int n)

{

double sd;

sd=(pow((s1-mean),2)+pow((s2-mean),2)+

                    pow((s3-mean),2)+pow((s4-mean),2))/n;

sd=sqrt(sd);

return sd;

}

See more about C code at brainly.com/question/25870717

What is the value of x after each of the following statements is encountered in a computer program, if x=1 before the statement is reached? Please, justify your answer.
a) if (1+2=3) then x:=x+1
b) if ((1+1=3) OR (2+2=3)) then x:=x+1
c) if ((2+3=5) AND (3+4=7)) then x:=x+1

Answers

Answer:

x=2

x=1

x=2

Explanation:

a)

This if statement if (1+2=3) checks if the addition of two numbers 1 and 2 is true. Here the addition of 1 and 2 is 3 which is true. So the condition becomes true.

Since the condition is true x:=x+1 statement is executed. This statement means that the value of x is incremented by 1.

The value of x was 1 before the if statement is reached. So x:=x+1 statement will add 1 to that value of x.

x:=x+1 means x=x+1 which is x=1+1 So x=2

Hence value of x is 2 (x=2) after the execution of x:=x+1

b)

In statement b the value of x will be 1 because both the mathematical operations in the if statement evaluate to false.

which means in b, x:=x+1 will not be executed and value of x remains unchanged i.e x=1

In (c) the value x will be 2 because the condition in the if statement is true. Both mathematical expressions 2+3=5 and 3+4=7 are true. Therefore x:=x+1 will be executed and value of x will be incremented by 1. Hence x=2

The returns on assets C and D are strongly correlated with a correlation coefficient of 0.80. The variance of returns on C is 0.0009, and the variance of returns on D is 0.0036. What is the covariance of returns on C and D?A) 0.03020.B) 0.00144.C) 0.40110.D) 1.44024.

Answers

Answer:

Option (B) 0.00144

Explanation:

Data provided in the question:

Correlation coefficient, r = 0.80

Variance of returns on C  = 0.0009

Variance of returns on D, = 0.0036

Now,

r = Cov(C,D) / (σA x σB)

Thus,

covariance of returns on C and D,  Cov(C,D) = r × (σA x σB)

also,

σA = (0.0009) × 0.5 = 0.03             [ Since there are two assets, weight = 0.5 ]

σB = (0.0036) × 0.5 = 0.06

Therefore,

covariance of returns on C and D,  Cov(C,D) = 0.8 × 0.03 × 0.06)

or

covariance of returns on C and D = 0.00144

Hence,

Option (B) 0.00144

This class has one instance variable, a double called miles. The class has methods that convert the miles into different units.It should have the following methods:public Distance(double startMiles) - the constructor; initializes milespublic double toKilometers() - converts the miles to kilometers. To convert to kilometers, divide miles by 0.62137public double toYards() - converts miles to yards. To convert to yards, multiply miles by 1760.public double toFeet() - converts miles to feet. To convert to feet, multiply miles by 5280.public double getMiles() - returns the value of milesMain MethodTo test your class, create three Distance objects in main. One represents the distance between Karel and school, Karel and the park, and Karel and his best friend.Karel lives 5 miles from school. Karel lives 10 miles from the park. Karel lives 12 miles from his best friend.Your program should use the methods from Distance to print the number of:1. yards Karel lives from school2. kilometers Karel lives from the park3. feet Karel lives from his best friend

Answers

Answer:

The class definition with the instance variable and all the required methods is given below:

public class Distance{

   double miles;

   public Distance (double startMiles) {

       this.miles = startMiles;

   }

   public double toKilometers ( ){

         double kilometerValue = miles/0.62137;

         return kilometerValue;

       }

   public double toYards(){

       double yardsValue = miles*1760;

       return yardsValue;

       }

   public double toFeet(){

       double feetsValue = miles*5280;

       return feetsValue;

       }

   public double getMiles(){

       return miles;

       }

}

The main method to test the class is given in the explanation section

Explanation:

public class Main {

   public static void main(String[] args) {

       Distance karelToSchool = new Distance(5.0);

       Distance karelToPark = new Distance(10.0);

       Distance karelToFriend = new Distance (12.0);

       double karel_Yards_From_School = karelToSchool.toYards();

       System.out.println("Karel's Yards from School is "+karel_Yards_From_School);

       double karel_kilometers_from_park = karelToPark.toKilometers();

       System.out.println("Karel's Kilometers from Park is "+karel_kilometers_from_park);

       double karel_feets_from_friend = karelToFriend.toFeet();

       System.out.println("Karel's Feets from Friend is "+karel_feets_from_friend);

   }

}

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between 0 and 9. End with a newline. Ex:
5
7
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activ

Answers

Answer:

The C++ code is given below with appropriate comments

Explanation:

//Use stdafx.h for visual studio.

#include "stdafx.h"

#include <iostream>

//Enable use of rand()

#include <cstdlib>

//Enable use of time()

#include <ctime>

using namespace std;

int main()

{

    //Note that same variable cannot be defined to two

    //different type in c++

    //Thus, use either one of the two statement

    //int seedVal=0;time_t seedVal;

    //int seedVal=0;

    time_t seedVal;

    seedVal = time(0);

    srand(seedVal);

    //Use rand to generate two number by setting range

    // between 0 and 9. Use endl for newline.

    cout << (0 + rand() % ((10 - 0) + 0)) << endl;

    cout << (0 + rand() % ((10 - 0) + 0)) << endl;

    //Use for visual studio.

    system("pause");

    return 0;

}

To seed the random number generator, use srand(seedVal);. To generate and print two random integers between 0 and 9, use two separate calls to rand() % 10 with a newline character at the end of each print statement.

To seed the random number generator using srand(), you would use the variable seedVal as follows:

srand(seedVal);

Then to print two random integers between 0 and 9, you should call rand() twice using separate statements and utilize the modulus operator to ensure the numbers fall within the desired range:

printf("%d\n", rand() % 10);
printf("%d\n", rand() % 10);

Each call to rand() should be followed with a newline character for clear output separation.

In the following code, what is the first line that introduces a memory leak into the program?

(Type the line number into the box below)

1: #include
2: #include
3: #include
4: int main() {
5:char *word1 = NULL;
6: word1 = malloc(sizeof(char) * 11);
7: word1 = "bramble";
8: char *word2 = NULL:
9: word2 = malloc(sizeof(char) * 11);
10: word2 = word1;
11: return 0;
12: }

Answers

Answer:

The description of the given code is given below:

Explanation:

Memory leak:

In a program, if memory is assigned to the pointer variables but that memory is already released previously then the condition of occurring the memory leakage.

Now the program :

#include <stdio.h>  //header file

#include <stdlib.h>  //header file

#include <string.h> //header file

int main()   //main function

{

char *word1 = NULL;   //line 1 (as given in the question)

word1 = malloc(sizeof(char) * 11);  //line 2

free(word1);  //free the memory of pointer word1  line 3

word1 = "bramble";   //line 4

char *word2 = NULL;   //line 5

word2 = malloc(sizeof(char) * 11);   //line 6

free(word2);  //free the memory of pointer word2  line 7

word2 = word1;   //line 8

return 0;   //line 9

}

Therefore, line 3 is the first line that introduce a memory leak anf after that line 7 introduce it in a program.

Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full sentence string with the following content and format: Your name is [name] and you live in [city], [state].

Answers

Answer:

Below are the function for the above question in java Language---

void show_info(String name,String home,String state)

    {

        System.out.println("Your name is "+name+" and you live in "+ home+" ,"+state +".");

    }

Output:

If the user inputs name="Gaus",city="LosAngeles" and state="California" then the output will be "Your name is Gaus and you live in LosAngeless, California."

Explanation:

The above function is in java language which takes three argument names, state, and the city.The name will be stored on the name variable of the string type.The state will be stored on the state variable of string type.The city will be stored on the city variable of the string type.Then the Output will be displayed with the help of the print function.'+' is used to merge the string.

Universal Containers has the following requirements:
A custom Loan object requires Org-Wide Defaults set to Private. The owner of the Loan record will be the Loan Origination Officer. The Loan record must be shared with a specific Underwriter on a loan-by-loan basis. The Underwriters should only see the Loan records for which they are assigned.

What should the Architect recommend to meet these requirements?

A. Use criteria-based sharing rules to share the Loan object with the Underwriter based upon the criteria defined in the criteria-based sharing
B. Create a lookup relationship from the Loan object to the User object. Use a trigger on the Loan object to create the corresponding record in the Loan share object
C. Create a master-detail relationship from the Loan to the User object. Loan records will be automatically shared with the Underwriter
D. Create an Apex Sharing Reason on the Loan object that shares the Loan with the Underwriter based upon the criteria defined in the Sharing Reason

Answers

Answer:

The answers is B

Explanation:

In order for the architect to meet the following requirements;

# A custom Loan object requires Org-Wide Defaults set to Private.

# The owner of the Loan record will be the Loan Origination Officer.

# The Loan record must be shared with a specific Underwriter on a loan-by-loan basis.

# The Underwriters should only see the Loan records for which they are assigned.

The architect should recommend

(B.) Creating a lookup relationship from the Loan object to the User object. Use a trigger on the Loan object to create the corresponding record in the Loan_share object

what is the clorox logo font?

Answers

Answer:

The answer is "bump".

Explanation:

In the logo Clorox, it is the company brand name, which provides the cleaning products. In this logo design the "bump" font is used which can be described as follows:

The bump is a definition of a level surface with a physical difference. It is also known as a font that is freely available on the internet. This font is available for individual use, and it also contains characters in the European language.
Other Questions
Suppose a normally distributed set of data has a mean of 102 and a standard deviation of 20. Use the 68-95-99.7 Rule to determine to determine the percent of scores in the data set expected to be below a score of 151. Give your answer as a percent and includeas many decimal places as the 68-95-99.7 rule dictates. (For example, enter 99.7 instead of 0.997.) In a collection of toys, 1/2 are red, 1/2 are waterproof, and 1/3 are cool. 1/4 are red and waterproof. 1/6 are red and cool. 1/6 are waterproof and cool. 1/6 are neither red, waterproof, nor cool. Each toy has an equal chance of being selected.Draw an area diagram to represent these events. what does democracy mean in the sentences above which area of chemistry deals with the mechanism the rate and the energy transfer that occurs when the matter undergoes a change? a. biob. organic c. unorganic d. physical A veterinarian's office recorded one particular week that they had 50 patients. The following table shows the recorded number of dogs.MondayTuesdayWednesdayThursdayFriday74552The formula for standard error is given below, where represents the sample proportion, and n is the total number of elements in the sample.Use the given data to complete the table below.Percentage of patients that were dogs [23%; 42%; 22%; 46%]Standard error [.07; .09; .05; .16]Margin of error 90% confidence interval [(32%, 60%)(34%,58%)(6%, 23%)(5%,21%)]Margin of error 95% confidence interval [(32%, 60%)(34%,58%)(6%, 23%)(5%,21%)] An aquarium is to be drained. The aquarium is shaped like a rectangular prism with length 33 in , width 26 in , and height 12 in . Suppose water is pumped out of the aquarium at a rate of 396 in^3 per minute. If the aquarium starts completely full, how many minutes does it take to empty the aquarium? Measuring a company's business transactions and communicating those measurements for decision-making purposes in the form of financial statements are two key functions of financial accounting. The full set of procedures used to accomplish both of these key functions is called the: Which of these has NOT provided evidence showing that the continentshave drifted over time?O A) rocksOB) fossilsOC) earthquakesOD) geologic structures si p+ 2p+3p=12, cual es el valor de 5p -1 A triangle with equal sides of length 14 cm has -2.5-nC charged objects at each corner. Determine the direction of the electrical force exerted on the object at the top corner due to the two objects at the horizontal base of the triangle.(A) vertically down (B) Vertically upward (C) horizontally rightward (D) horizontally leftward The ability of the United States to respond rapidly with appropriate options to potential or actual crises contributes to regional stability. Thus, _________ often may be planned and executed as crisis response or limited-contingency operations.a. Large-Scale Combat Operationsb. Decisive Operationsc. Joint Operationsd. Stability Operations Which social science is described here? Enter the correct number in the answer box.People, government and societies choose how to use scarce resources to produce items for consumption.1) anthropology2) psychology3) sociology4) economics5) political science6) history7) geography8) social work 1. Estas faldas elegantes estn de moda. 2. Compraste aquel traje marrn? 3. Estos sombreros cuestan cuarenta dlares. 4. Pienso comprar aquellas camisas verdes. 5. Esa vendedora est organizando los zapatos. Foraging bees often move in straight lines away from and toward their hives. Suppose a bee starts at its hive and flies 500 m due east, then flies 430 m west, then 670 m east. How far is the bee from the hive The term "utilization" denotes the fraction of time a resource is busy. Let's say your workload gradually increases, from you not being busy at all, to the point where you are now busy just less than half the time, meaning your utilization is now approaching 50%. Let's further say that your workload will continue to increase from here. If your workload quadruples from its current level, how many extra people should you hire to be able to handle all the work (assume that any person you hire will be exactly as productive as you)? Which situation is in equilibrium? if a mint is on a turn table that is rotating at 34 RPMs, and is 23 (cm) away from the center of the record, what is the Tangential Acceleration? Evaluate the expressions 3x-2 and 4x+4 for the following value of x. Getting bystanders involved is the most effective way toA increase intimidationB stop a cyber bullyc eliminate harassmentD stop bullying (1 point) Let C be the positively oriented square with vertices (0,0)(0,0), (1,0)(1,0), (1,1)(1,1), (0,1)(0,1). Use Green's Theorem to evaluate the line integral C1y2xdx+9x2ydyC1y2xdx+9x2ydy. Steam Workshop Downloader