Create a C# Console program named TipCalculationthat includes two overloaded methods named DisplayTipInfo.

One should accept a meal price and a tip as doubles (for example, 30.00 and 0.20, where 0.20 represents a 20 percent tip).
The other should accept a meal price as a double and a tip amount as an integer (for example, 30.00 and 5, where 5 represents a $5 tip).
Each method displays the meal price, the tip as a percentage of the meal price, the tip in dollars, and the total of the meal plus the tip. Include a Main() method that demonstrates each method.
For example if the input meal price is 30.00 and the tip is 0.20, the output should be:
Meal price: $30.00. Tip percent: 0.20
Tip in dollars: $6.00. Total bill $36.00
Looks like this so far:
using static System.Console;
class TipCalculation
{
static void Main()
{
// Write your main here
}
public static void DisplayTipInfo(double price, double tipRate)
{
1}
public static void DisplayTipInfo(double price, int tipInDollars)
{
}

}

Answers

Answer 1

Answer:

The code for the program is given in the explanation

Explanation:

using System;

using static System.Console;

class TipCalculation

{

   //definition of the Main()

   static void Main()

   {      

       double dPrice, dTip;

       int iTip;

       //prompt and accept a meal price and a tip as doubles

       Write("Enter a floating point price of the item : ");

       dPrice = Convert.ToDouble(Console.ReadLine());

       Write("Enter a floating point tip amount: ");

       dTip = Convert.ToDouble(Console.ReadLine());

       //call the method DisplayTipInfo()

       //with doubles

       DisplayTipInfo(dPrice, dTip);

       //prompt and accept a meal price as a double

       //and a tip amount as an integer

       Write("\nEnter a floating point price of another item : ");

       dPrice = Convert.ToDouble(Console.ReadLine());

       Write("Enter a integral tip amount: ");

       iTip = Convert.ToInt32(Console.ReadLine());

       //call the method DisplayTipInfo()

       //with double and an integer

       DisplayTipInfo(dPrice, iTip);

   }

   //definition of the method DisplayTipInfo()

   //accept a meal price and a tip as doubles

   public static void DisplayTipInfo(double price, double tipRate)

   {

       //find the tip amount

       double tipAmount = price * tipRate;

       //find the total amount

       double total = price + tipAmount;

       //print the output

       WriteLine("Meal price: $" + price.ToString("F") + ". Tip percent: " + tipRate.ToString("F"));

       WriteLine("Tip in dollars: $" + tipAmount.ToString("F") + ". Total bill $" +          total.ToString("F"));

   }

   //definition of the method DisplayTipInfo()

   //accept a meal price and a tip as doubles

   //a meal price as a double and a tip amount as an integer

   public static void DisplayTipInfo(double price, int tipInDollars)

   {

       //find the tip rate

       double tipRate = tipInDollars / price;

       //find the total amount

       double total = price + tipInDollars;

       //print the output

       WriteLine("Meal price: $" + price.ToString("F") + ". Tip percent: " +                 tipRate.ToString("F"));

       WriteLine("Tip in dollars: $" + tipInDollars.ToString("F") + ". Total bill $" +               total.ToString("F"));

   }

}

Answer 2

In this exercise we have to write a C code requested in the statement, like this:

find the code in the attached image

We can write the code in a simple way like this below:

using System;

using static System.Console;

class TipCalculation

{

  //definition of the Main()

  static void Main()

  {    

      double dPrice, dTip;

      int iTip;

      Write("Enter a floating point price of the item : ");

      dPrice = Convert.ToDouble(Console.ReadLine());

      Write("Enter a floating point tip amount: ");

      dTip = Convert.ToDouble(Console.ReadLine());

      DisplayTipInfo(dPrice, dTip);

      Write("\nEnter a floating point price of another item : ");

      dPrice = Convert.ToDouble(Console.ReadLine());

      Write("Enter a integral tip amount: ");

      iTip = Convert.ToInt32(Console.ReadLine());

      DisplayTipInfo(dPrice, iTip);

  }

  public static void DisplayTipInfo(double price, double tipRate)

  {

      double tipAmount = price * tipRate;

      double total = price + tipAmount;

      WriteLine("Meal price: $" + price.ToString("F") + ". Tip percent: " + tipRate.ToString("F"));

      WriteLine("Tip in dollars: $" + tipAmount.ToString("F") + ". Total bill $" +          total.ToString("F"));

  }

  public static void DisplayTipInfo(double price, int tipInDollars)

  {

         double tipRate = tipInDollars / price;

      double total = price + tipInDollars;

      WriteLine("Meal price: $" + price.ToString("F") + ". Tip percent: " +                 tipRate.ToString("F"));

      WriteLine("Tip in dollars: $" + tipInDollars.ToString("F") + ". Total bill $" +               total.ToString("F"));

  }

}

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

Create A C# Console Program Named TipCalculationthat Includes Two Overloaded Methods Named DisplayTipInfo.One

Related Questions

Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and integer as input, and outputs a sentence using those items as below. The program repeats until the input string is quit. Ex: If the input is:

Answers

Answer: Complete a short story

#include<iostream>  

//built in library provides basic input and output services

using namespace std;

//declarative region that provides a scope to the identifiers (names of the

//types, function, variables etc

int compare(char[]);

//User defined function which takes a character array as argument.

int main()

//Main body of the program

{

       // 3 strings are initialized as empty: userinput, integer, word

char integer[50] = { 0 }, userinput[50] = { 0 }, word[50] = { 0 };

       //Variable declaration

int value;

int loopvalue = 0;

do {

 /*input string from user*/

 cout << "enter string";

 cin.getline(userinput, 50);

 /*initialize loop variables*/

 loopvalue = compare(userinput);

 if (!loopvalue) {

  return 0;

 }

 int i = 0; // for userinput

 int j = 0; // after having space to store integer

 int fillnum = 0; // to store integer

 while (userinput[i]) {

  if (userinput[i] == ' ')

                         {

//checking if there is a space then time to store an integer (here we are treating integer as a string)

   int j = i + 1;

   while (userinput[j]) {

    integer[fillnum] = userinput[j];

    fillnum++; j++;

   }

   break;

  }

  else {

// if there is no occurrence of space then store alphabet considering it for a word

   word[j] = userinput[i];

   j++;

  }

  i++;

 }

 cout << "Eating " << integer<< " "<<word <<" a day keeps the doctor away" <<endl;

 

} while (loopvalue);

}

int compare(char str[])

{

int i = 0;

char checkstring[] = "quit";

while (str[i] != '\0' || checkstring[i] != '\0')

// checking until the character in both arrays not reach to the null character

{

 if ((str[i])>(checkstring[i]) || (str[i])<(checkstring[i]))

  return 1;

 else

  i++;

}

return 0;

}

Explanation:

A c++ program is written to solve this problem. The explanation of each step is written in the program by using c++ comments.

// This symbol shows single line comment

/* */   These symbols shows multi line comment. Starting symbol is /* and ending symbol is */  

cin.getline() is used to read unformatted string (set of characters) from the standard input device (keyboard).

char[ ] creates a character array which is like any other array.

return 0; The main function is of type int so it should return an integer value. It represent "Exit Status" of the program. Returning 0 is also a success status like saying "The program worked fine"

'\0' is the null character which terminate the string. Without it, the computer has no way to know how long that group of characters.

|| means OR. so it is true if at least one of the terms is true, false otherwise.

To see output, by giving your own input you can use any c++ compiler or IDE(Integrated Development Environment).

Happy Coding :)

Sure! Here's an example implementation of a Mad Libs program in Python:

def mad_libs(word, number):

   return f"The {word} jumped over {number} lazy dogs."

while True:

   input_str = input("Enter a word (or 'quit' to exit): ")

   if input_str.lower() == "quit":

       break

   input_num = input("Enter a number: ")

   try:

       input_num = int(input_num)

       print(mad_libs(input_str, input_num))

   except ValueError:

       print("Please enter a valid number.")

print("Goodbye!")

This program defines a `mad_libs` function that takes a word and a number as input and returns a sentence with those items filled in. It then repeatedly prompts the user for input until they enter "quit", at which point the program exits.

Create an array of doubles with 5 elements. In the array prompt the user to enter 5 temperature values (in degree Fahrenheit). Do this within main. Create a user defined function called convert2Cels. This function will not return any values to main with a return statement. It should have parameters that include the temperature array and the number of elements. The function should convert the values for Fahrenheit to Celsius and save them back into the same array. Celsius=(F-32)*5/9 From main, print the modified temperature array in a single column format similar to one shown below: Temperatures(Celsius) 37.78 65.56 100.00 0.00 21.11 Test your program with the following values: 100 150 212 32 70

Answers

Answer:

The solution code is written in Java.

import java.util.Scanner; public class Main {    public static void main(String[] args) {        double myArray [] = new double[5];        Scanner reader = new Scanner(System.in);        for(int i=0; i < myArray.length; i++){            System.out.print("Enter temperature (Fahrenheit): ");            myArray[i] = reader.nextDouble();        }        convert2Cels(myArray, 5);        for(int j = 0; j < myArray.length; j++){            System.out.format("%.2f \n", myArray[j]);        }    }    public static void convert2Cels(double [] tempArray, int n){        for(int i = 0; i < n; i++){            tempArray[i] = (tempArray[i] - 32) * 5 / 9;        }    } }

Explanation:

Firstly, let's create a double-type array with 5 elements, myArray (Line 6).

Next, we create a Java Scanner object to read user input for the temperature (8).

Using a for-loop that repeats iteration for 5 times, prompt user to input temperature in Fahrenheit unit and assign it as the value of current element of the array. (Line 11 - 12). Please note the nextDouble() method is used to read user input as the data type of input temperature is expect in decimal format.

At this stage, we are ready to create the required function convert2Cels() that takes two input arguments, the temperature array,  tempArray and number of array elements, n (Line 23).  Using a for-loop to traverse each element of the tempArray and apply the formula to convert the fahrenheit to celcius.  

Next, we call the function convert2Cels() in the main program (Line 15) and print out the temperature (in celsius) in one single column (Line 17-19). The %.2f in the print statement is to display the temperature value with 2 decimal places.

Identify the kind of argument.
Using a lemon when cooking is like using a lime. Given that limes can be added to bland foods to give them some zest, lemons, too, will give zest to bland foods.

a. Analogical argument
b. Categorical argument
c. Truth-functional argument
d. Causal argument

Answers

Answer:

B

Explanation:

A categorical argument or syllogism consists of deductive statement based on two premises. For example the highlighted statements:

No boy is a girl

Some humans are boys

Therefore, some humans are girls

is a categorical argument which consists of two premises (No boy is a girl, some humans are boys) and a deduction (Therefore, some humans are girls). The deduction is made by using the premises as the basis.

In the question, the two premises are:

Using a lemon when cooking is like using a lime

Limes add to bland foods to give them some zest

The deduction is:

Therefore, lemons too will give zest to bland foods

Thus, representing a categorical argument.

Assume that you have an ArrayList variable named a containing 4 elements, and an object named element that is the correct type to be stored in the ArrayList.

Which of these statements adds the object to the end of the collection?1. a[3] = element;
2. a.add(element;
3. a[4] = element;
4. a.add(element);

Answers

Answer:

Option (4) is the correct answer.

Explanation:

In Java programming language ,array collection starts from 0 index location and ends in a size-1 index location. So to access the last elements the user needs to use a[Size-1] statement. so to modify the value of the last location of the array the user needs to use "a[size-1]= element;".

But when the user wants to add some new value to the end of the array list collection then he needs to use the statement--

a.add(element); //where add is a function, element is a value and a is a array list object.

Another option is invalid because--

Option 1 is not the correct because "a[3]=element;" modify the value of the 3rd element of the array.Option 2 gives a compile-time error because add functions bracts are not closed.Option 3 gives the error because a[4] gives the location of the 5th element of the array but the above question says that a is defined with 4 elements.

Discuss why it is common for XML to be used in interchanging data over the Internet. What are the advantages of using XML in data interchanging?

Answers

Answer:

Gives a clear structure for storing data

Explanation:

XML provide files that are clear to read and simple to produce, data are stored in form of text and in turn it is used as a transfer mechanism that defines how the structure or model should look like. XML is also usually described as a format that describes itself, and it is easy to learn and use.

Nonverbal codes: (Select one)

(A) consist of symbols and their grammatical arrangement.
(B) are a systematic arrangement of symbols used to create meanings in the mind of another person or persons.
(C) are all symbols that are not words, including bodily movements, the use of space and time, and sounds other than words.
(D) are any interference in the encoding and decoding processes that reduces the clarity of a message.
(E) are the location where communication takes place.

Answers

Answer:

Option C: is the correct answer.

Nonverbal codes are all symbols that are not words, including bodily movements, the use of space and time, and sounds other than words.

Explanation:

As depicted from the word, nonverbal means free of words.

Sometimes, there are situations when instead of conveying anything by the usage of words, codes and gestures are used. These gestures may be provided using hands, eyes, time pauses etc.

So a non-verbal codes can also be defined as:

" A behavioral act that maybe depicted through sounds and body movements instead using words."

i hope it will help you!

In cell B3 in the Bonnet sheet, create a validation rule with these specifications: • Whole number less than or equal to $350. • Input message title Professional Membership and input message Enter the amount of the annual professional membership dues. • Error alert style Warning, alert title Too Expensive, and error message The amount you tried to enter exceeds $350. Please select a less expensive membership.

Answers

Answer:

Spread sheet application (eg Microsoft Excel).

Explanation:

Data validation is a very power tool in spread sheet applications like Excel. It is used to determine the type of data that should be inputted in a cell or group of cells or an entire column. To create a data validation rule, select the area or column(s), locate and click on the data tab in the ribbon menu, then locate data validation.

To input numbers, select the number tab on the new window, then whole number and range of the input value (it can also be customised). A message for the user can be set with a title and body, to alert the user of the needed input. For wrong input, an error message with a title and body, can be set to alert users of wrong entries.

Suppose that some company has just sent your company a huge list of customers. You respond to that company with a strongly worded note because you only wanted the phone number of one customer, Mike Smith. They, in turn, reply to you suggesting that you simply find him quickly using binary search. Explain why it might not, in fact, be possible to use binary search on the huge list.

Answers

Answer:

Explanation:

Actually this is possible

First sort the list of all names in ascending order based on string comparison (ASCII value)

The middle can be found as we have total number of contacts

Binary search can be applied by comparing the name string

If any of these is not given or time bound then binary search can not be applied.

In a brief essay explain the security vulnerabilities of transition methods (6to4, etc.)

Answers

Answer:

While transiting from IPv4  to IPv6, many offices and companies use both the protocols (Ipv4 and IPv6) at the same time. This scenario can increase the risk  rate of attack twice. All the flaws and vulnerabilities could be overlooked easily when transition is done.

On the other hand, while transiting Ipv6 to IPv4, the router does not tells or depicts that the communication is appropriate or if it could be used as a part of DoS attack that make it so much harder to trace the origin back.

The reason for the vulnerability of Transport Relay Translators (TRT) is that they do not apply Internet Protocol Security (IPSec) and thats why they are not secure.

i hope it will help you!

Universal Containers uses a custom field on the account object to capture the account credit status. The sales team wants to display the account credit status on opportunities Which feature should a system administrator use to meet the requirements?

Answers

Answer:

Cross-object formula field

Explanation:

A Cross-object formula is a formula which does span two related objects, and then references merge fields on those same objects. Which makes it the best feature for the system administrator to display the account credit status on opportunities.

You are designing a distributed application for Azure. The application must securely integrate with on-premises servers. You need to recommend a method of enabling Internet Protocol security (IPsec)-protected connections between on-premises servers and the distributed application. What should you recommend?

Answers

Answer:

Azure Site-to-Site VPN

Explanation:

Distributed applications are computer softwares that run and work with each other on different computers that are registered under a network to execute a specific task.

And the method of enabling Internet Protocol security (IPsec)-protected connections between on-premises servers and the distributed application is a Site-to-Site VPN.

Azure Site-to-Site VPN gateway connection is used to securely integrate with on-premises servers. It is used to send encoded messages.

Answer:

Azure Site-to-Site VPN

Explanation:

First of all what is a distributed application

According to Techopedia  

 A distributed application is software that is executed or run on multiple computers within a network. These applications interact in order to achieve a specific goal or task.  

Azure distributed applications are software that run on Azure which is a cloud base technology that not only provides an Application Hosting environment, but also a full-scale Development Platform.  

In order to understand why this answer for this question we need to also understand what an On-premises server is.

On-premises:  

This can be defined as a computer application that is always found at a company's data center instead of running it on a hosted server or in the cloud  

Now an Azure Site-to-Site VPN is the recommended method for enabling Internet Protocol security (IPsec)-protected connections between on-premises servers and the distributed application because IPsec can be used on Site-to-Site VPN, and Distributed applications can used the IPSec VPN connections to communicate.

Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) constructed using the following rules. The rules for addition into the new dictionary are as follows: Add key/value pairs from d2 into d1. If a key from d2 already appears in d1: the new value in d1 is the sum of the values If a key appear

Answers

Answer:

def merge_dict(d1, d2):    for key in d2:        if key in d1:            d1[key] += d2[key]        else:            d1[key] = d2[key]        return d1 d1 = {    'a': 5,    'b': 8,    'c': 9  } d2 = {    'c': 5,    'd': 10,    'e': 12 } modified_dict = merge_dict(d1, d2) print(modified_dict)

Explanation:

Firstly, create a function merge_dict() with two parameters, d1, d2 as required by the question (Line 1)

Since our aim is to join the d2 into d1, we should traverse the key of d2. To do so, use a for loop to traverse the d2 key (Line 2).

While traversing the d2 key, we need to handle two possible cases, 1) d2 key appears in d1, 2) d2 key doesn't appears in d1. Therefore, we create if and else statement (Line 3 & 5).

To handle the first case, we add the values of d2 key into d1 (Line 4). For second case, we add the d2 key as the new key to d1 (Line 6).

Next, we can create two sample dictionaries (Line 11 - 20) and invoke the function to examine the output. We shall get the output as follows:

{'a': 5, 'b': 8, 'c': 14, 'd': 10, 'e': 12}

The Account class contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a String representation. Modify the file as follows:1. Overload the constructor as follows:a. public Account (double initBal, String owner, long number) - initializes the balance, owner, and account number as specified.b. public Account (double initBal, String owner) - initializes the balance and owner as specified; randomly generates the account number.c. public Account (String owner) - initializes the owner as specified; sets the initial balance to 0 and randomly generates the account number.2. Overload the withdraw method with one that also takes a fee and deducts that fee from the account.

Answers

Answer:

I've updated the Account class as per the instructions. The instructions mention "the constructor for this class creates a random account number" although I didn't find where that was. As a result, I created a simple method to generates the account number (located at the bottom of the class). Be sure you understand the changes (highlighted in yellow) and feel free to ask follow-up questions:

Explanation:

//*******************************************************

// Account.java

//

// A bank account class with methods to deposit to, withdraw from,

// change the name on, and get a String representation

// of the account.

//*******************************************************

import java.util.Random;   // Used for Random # generator

public class Account

{

      private double balance;

  private String name;

     private long acctNum;

      //----------------------------------------------

 //Constructor -- initializes balance, owner, and account number

  //----------------------------------------------

 public Account(double initBal, String owner, long number)

{

        balance = initBal;

               name = owner;

            acctNum = number;

}

// !!!!!! New Constructor !!!!!!

public Account(double initBal, String owner)

     {

        balance = initBal;

               name = owner;

            acctNum = generateAccountNumber();

       }

  // !!!!!! New Constructor !!!!!!

 public Account(String owner)

     {

        balance = 0;

             name = owner;

            acctNum = generateAccountNumber();

       }

   //----------------------------------------------

 // Checks to see if balance is sufficient for withdrawal.

// If so, decrements balance by amount; if not, prints message.

  //----------------------------------------------

 public void withdraw(double amount)

      {

        if (balance >= amount)

                balance -= amount;

               else

                     System.out.println("Insufficient funds");

}

 // !!!!!! New withdraw() method !!!!!!

   public void withdraw(double amount, double fee)

  {

        double amountWithFee = amount + fee;

               if (balance >= amountWithFee)

                 balance -= amountWithFee;

        else

                     System.out.println("Insufficient funds");

}

   //----------------------------------------------

 // Adds deposit amount to balance.

       //----------------------------------------------

 public void deposit(double amount)

       {

        balance += amount;

       }

  //----------------------------------------------

 // Returns balance.

      //----------------------------------------------

 public double getBalance()

       {

        return balance;

  }

    //----------------------------------------------

 // Returns a string containing the name, account number, and balance.

    //----------------------------------------------

 public String toString()

 {

        return "Name:" + name +

          "\nAccount Number: " + acctNum +

         "\nBalance: " + balance;

 }

 // !!!! NEW PRIVATE HELPER METHOD TO GENERATE ACCOUNT NUMBERS !!!!!

//-------------------------------------------------------

// Returns a random account number between 10000 - 99999

 //--------------------------------------------------------

       private long generateAccountNumber()

     {

        Random r = new Random();        // Seed the random number genertor with the system time

         return 10000 + r.nextInt(89999);        // .nextInt(89999) will return a value between 0 and 89999)

      }

}

g Define a write through cache design. A. A block of main memory may be loaded into any cache line. B. Each block of main memory is mapped to exactly one cache line. C. A block of main memory is mapped to a group cache lines. D. When the CPU writes a word, the data is immediately written both to cache and to main memory. E. When the CPU reads a word, the cache writes part of a block to memory.

Answers

Answer:

Option D is the correct answer.

Explanation:

"Write through cache" is a writing technique in which any data is written in memory and the cache at the same time to overcome the problem of loss of data. This is a concept of "Write through cache". It means that, if the data is written at the two positions at the same time then the loss of data problem is not occurring and the users can save the data.

Here in the question, option D states the same concept which is defined above. That's why Option D is correct. while the other option is not correct because-

Option "a" states about the block of memory which can load on the cache which is not states about the above concept.Option "b" states about the mapping concepts.Option "C" also states about the mapping concepts.Option "E" states to write that data on cache, which is read from the memory.  

In the process of conducting design considerations a program's systems engineers should check?

Answers

Answer:

The program's systems engineer must first check for the problem which is to be solved and possible ways to achieve them.

Explanation:

The process of conducting a design first thing would be to identify the need i.e. what problem will the design be solving.

Then identifying the target population, which is the people that will be benefiting from the design.

Next would be the design need and constraints, the need refers to what would be needed to achieve the design aim while the constraint would be the problems or hindrance to achieving the design aim.

Encoding is the process:
Select one:
a. of assigning meaning to an idea or thought
b. and location where communication takes place
c. of translating an idea or a thought into a code
d. of any interference in the encoding and decoding processes that reduces the clarity of a message
e. of arrangement of symbols used to create meanings

Answers

Answer:

Of translating an idea or a thought into a code

Explanation:

Encoding is the process of translating an idea or a thought into a code.

For example:

You want a friend to get you a gaming Laptop as a birthday gift, while describing the specification and how the laptop should look like. You visualize a fast laptop in black cover. You tell your friend it is "fast and portable". You translate your perceptions on a particular laptop into words that describe the model.

Create a base class named rectangle that contains lenght and width data members.

Form this class derive a class named Box having an additional data member named depth. The function members of the base rectangle class should consist of a constructor and an area function.

The derived box class should have a constructor, a voulume function, and an override function named area that returns the surface area of the box.

Answers

Answer:

class Rectangle:  

   

   def __init__(self, length, width):

       self.length = length

       self.width = width

       

   

   def area(self):

       area = self.length*self.width

       return area

   

   

class Box (Rectangle):

   

   def __init__(self, length, width, height):

       super().__init__(length, width)

       self.height = height

       

   def volume(self):

       volume = self.length * self.width * self.height

       return volume

   

   def area(self):

       area = 2*(self.length*self.width) + 2*(self.length*self.height) + 2*(self.width*self.height)

       return area

rec_1 = Rectangle(2,4)

box_1 = Box(2,2,6)

print(box_1.length)

print(box_1.area())

   

print(rec_1.length)

print(rec_1.area())

Explanation:

The programming language used is python.

class Rectangle

The class Rectangle is created with attributes length and width.

The class attributes are initialized using the __init__ constructor.

In the rectangle class, a method/function is declared to return the area of the rectangle.

class Box

This class is a child of rectangle and it inherits all its attributes and methods,

It has an additional attribute of depth and its constructor is used to initialize it.

The class contains a volume function, that returns the volume and an override function 'area()' that displaces the area from the parent class.

Finally, some instances of both classes are created.

Which type of testing is done when one of your existing functions stop working?

Answers

Answer:

The correct answer for the given question is "alpha testing".

Explanation:

The main aim of the alpha testing is to solve all the issues like debugging, error before the software is released into the market.This type of testing is done by the programmer when any issue occurs .in the software testing cycle firstly the alpha testing is performed when the alpha testing is finished then after beta testing is performed .

The alpha testing is tested the existing module or the function when it stops the working. The programmer checks that existing module it checks if any error occurs then it corrected that module.

Complete this assignment in Python 3.x. Make sure you have downloaded the software, and it is installed correctly.

You will code the following and submit it in one file. Use the information in the Lessons area for this week to assist you. Save it as a python file (.py), and upload it into the Assignments area.

Create a comment block (starts at line 1 in the code) with the following information:

Your Name
Course Name, Section (example: ENTD200 B002 Spr15)
Instructor name
Week #
Date completed
Problem 1: Create a list (or tuple only, no dictionary) that contains the months of the year. ( do not hardcode the number)
Problem 2: Create a loop to print the number and the months of the year from the list.
The output should like this:

Month 1 is January
Month 2 is February
….
….

Month 12 is December

Optional 1

Month 1 is January, ...Happy new year ( Do not use if-then)

The output will look like this

Month 1 is January , ...Happy New Year!
Month 2 is February, ...Happy Valentine!
Month 3 is March
Month 4 is April
Month 5 is May
Month 6 is June
Month 7 is July, ...Happy Fourth of July!
Month 8 is August
Month 9 is September
Month 10 is October, ...Happy Halloween!
Month 11 is November, ...Happy Thanksgiving!
Month 12 is December, ...Merry Christmas!

Optional 2
Modify the Payroll and/or the MPG program from week5/6 to store the results in a list/dictionary. Print the list/dictionary when no more calculation is selected.
The output will be something like this for the payroll

Payroll for week xyz
James Bond ....... 21,500
Al Bundy ....... 500
Johnny English ….. 1,200
Total Payroll ....... 23,200

For the MPG will be something like

MPG for zyz truck
Week 1 ..... 12
Week 2 ..... 33
Week 3 ..... 27
MPG Ave ..... 24

Answers

Answer:

The program code is completed below

Explanation:

Program Code:

"""

  Your Name

  Course Name, Section (example: ENTD200 B002 Spr15)

  Instructor name

  Week #

  Date completed

"""

months = ["January ", "February", "March", "April", "May", "June", "July"

, "August", "September", "October", "November", "December"]

for i in range(0,12):

print("Month",i+1, "is" , months[i])

Suppose that you have been running an unknown sorting algorithm. Out of curiosity, you once stopped the algorithm when it was part-way done and examined the partially sorted array. You discovered that the first K elements of the array were sorted into ascending order, but the remainder of the array was not ordered in any obvious manner.

Based on this, you guess that the sorting algorithm could likely be:

Shell's Sort

heapsort

quicksort

merge sort

insertion sort

Answers

The sorting algorithm could likely be: insertion sort.

Insertion Sort

Explanation:

There are may sort is available in programming languages, in this situation  Insertion sort method is used. Here, in insertion sort, the array elements are compared with each other cells and find the smallest value from cells pushed front thus, forming a sorted ascending ordered array.

If we stop the algorithm midway, we would get a sorted array till where the iteration is stopped and the other elements are not sorted or ordered in any way. This sort is only used to find a small number from the array, thus it is easier sorting technique than others.

Write a JavaScript program that asks a user for their name, then, uses a function to do the following:

1. reverses the name;
2. replaces all the vowels with asterisks (*);
3. takes the first two letters and then adds a random number between 100 and 300 to it. The results should be written to the browser window using "document.write". Post the code to your solution below.

Answers

Answer:

       function DoStuff(name) {

           document.write('Reversed: ', name.split("").reverse().join(""), '<br/>');

           document.write('Masked vowels: ', name.replace(/[aeiouy]/ig, '*'), '<br/>');

           document.write('First two with number: ', name.slice(0, 2) + Math.floor(Math.random() * (300 - 100 + 1) + 100), '<br/>');

       }

       const name = prompt("Please enter your name", "Brainly exercise");

       DoStuff(name);

Explanation:

Brainly won't let me paste html here, so I'm just showing you the javascript. Let me know if you don't know how to embed this in a page. I'm a bit unsure about subassignment number 3. Does 'add' mean 'append' here?

The Windows ____ window allows you to create the graphical user interface for your application.

Answers

The Windows GUI window allows you to create the graphical user interface for your application.

A local variable is a variable that can only be accessed in the region in which it was defined.

A. True
B. False

Answers

The answer to this question would be, A. True

Which of these is a consequnce of removing a method declaration from an interface after it has been implemented?a. There are no consequences, interfaces can always be modified to remove methods. b. The method definitions would need to be removed from every subclass that implements the interface.c. Code would breakwhenever an interface reference is used to polymorphicaly call the method in an instance of an implementing class

Answers

Answer:

Option (a)

Explanation:

It will not produce any error as if a function is declared in the interface and then implemented by a class same function can be defined, but if that declaration is removed then also that class will consider that method as new declaration and it won't produce any type of error. For example : if following code of Java  is run -

interface printing{  

   void print_it();   //method declared

   }  

class Student implements printing{  

public void print_it()    //method implemented

{

   System.out.println("Hello World");

}      

public static void main(String args[]){  

Student obj = new Student();  

obj.print_it();    //method called

   }  

}

OUTPUT :

Hello world

But if the program is altered and declaration of print_it is deleted from the interface like following :

interface printing{  

//method is removed from here

   }  

class Student implements printing{  

public void print_it()    //method implemented

{

   System.out.println("Hello World");

}      

public static void main(String args[]){  

Student obj = new Student();  

obj.print_it();    //method called

   }  

}

Still no error is generated and same output is displayed as before.

Final answer:

Removing a method declaration from an interface that has been previously implemented would require all subclasses that implement the interface to have the method definition removed. Plus, code would break if an interface reference is polymorphically used to call out the removed method.

Explanation:

The consequnce of removing a method declaration from an interface after it has been implemented would be b and c. The method definitions would need to be removed from every subclass that implements the interface.

Also, if any part of your code is using an interface reference to polymorphically call the removed method on an instance of a class implementing the interface, then your code would break. This is because the compiler would expect to find a specific interface method in the implementing class, and if it's not there, it's going to throw a compilation error.

Learn more about interface here:

https://brainly.com/question/36759772

#SPJ3

Last year the major search engine stopped providing the keyword data when they forwarded the organic users who clicked over from their search results page. What this means is that the site receiving the visitor no longer could determine the performance of users and the specific keywords they used on the search engine to get to the site. In other words, the site's visibility of visitor history was significantly decreased.What effect do you think this had on the volume of traffic?

Answers

Answer:

This action by major search engine  would reduced the volume of traffic for site receiving the users from the search engine.

Explanation:

In order to get a better understanding of the answer above let first understand, what a keywords are.

Keywords are ideas and topics that define what the content of your website is about. In terms of SEO (Search Engine Optimization:it is the process that organizations go through to help make sure that their site ranks high in the search engines for relevant keywords and phrases) they're the words and phrases that searchers enter into search engines. These keyword are important because they are like a bridge between what people are searching for and the content you are providing to fill that need.

When this major search engine stopped providing this keyword data it meant that for those website who relied on those keywords to optimize their website in other to be top ranked on this major search engine and gain more traffic would no longer be able to gain access to these keyword and hence would fall in ranking on this major search engines and this in turn this would reduce the traffic to their website.    

3.25 LAB: Exact change Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 (or less than 0), the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes

Answers

The code is in Java.

The code uses if-else structure to check the amount of the pennies. It also uses nested if-else structure to check the amount of the each coin type. If there are corresponding values for any coin type, it converts it to that coin and prints the result.

Comments are used to explain the each line.

//Main.java

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 //Scanner object to get input from the user

 Scanner input = new Scanner(System.in);

 //Declaring the variables

 int pennies, nickels, dimes, quarters, dollars;

       

 //Getting the pennies from the user

 pennies = input.nextInt();

 

 /*

  * Checking if pennies is smaller than or equal to 0.

  * If it is, print "no change".

  * Otherwise, convert the pennies to corresponding values for dollars, quarters, dimes, nickels and pennies.

  * For example, since there are 100 pennies in a dollar, we divide the pennies to 100 to find the dollar value in pennies.

  * Then, we use modulo to get the remaining pennies.

  */

 if(pennies <= 0)

  System.out.println("no change");

 else {

  dollars = pennies / 100;

  pennies %= 100;

  quarters = pennies / 25;

  pennies %= 25;

  dimes = pennies / 10;

  pennies %= 10;

  nickels = pennies / 5;

  pennies %= 5;

 

  /*

   * After the conversion of all values, we check if the values are greater than 0.

   * This way, we find if a coin type is found in our pennies.

   * For example, if dollars value is 0, then we do not need to consider dollars because we do not have any dollars in our pennies.

   */

 

  /*

   * Then, we check if the coin type is equal to 1 or not.

   * This way, we decide whether it is plural or not.

   * And finally, we print the result.

   */

 

  if(dollars > 0){

   if(dollars == 1)

    System.out.println(dollars + " dollar");

   else

    System.out.println(dollars + " dollars");

  }

  if(quarters > 0){

   if(quarters == 1)

    System.out.println(quarters + " quarter");

   else

    System.out.println(quarters + " quarters");

  }

  if(dimes > 0){

   if(dimes == 1)

    System.out.println(dimes + " dime");

   else

    System.out.println(dimes + " dimes");

  }

  if(nickels > 0){

   if(nickels == 1)

    System.out.println(nickels + " nickel");

   else

    System.out.println(nickels + " nickels");

  }

  if(pennies > 0){

   if(pennies == 1)

    System.out.println(pennies + " penny");

   else

    System.out.println(pennies + " pennies");

  }

 }

}

}

You may see another example that uses nested if in the following link:

brainly.com/question/21891519

Accessor instance method names typically begin with the word "____" or the word "____" depending on the return type of the method.1. set, is
2. get, can
3. set, get 0%
4. get, is

Answers

Answer:

Accessor instance method names typically begin with the word "Get" or the word "Is" depending on the return type of the method.

Explanation

These methods are also called get methods. These are the type of instances that allow to get variable value from the outside of class.

This is the reason that this type of instances start with the word Get.

For Example

an instance could be started as

public datatype of variable getvarname

{

}

Consider the following declaration.int[] beta = new int[3];int j;Which of the following input statements correctly input values into beta? (Assume that cin is a Scanner object initialized to the standard input device.)(i)beta[0] = cin.nextInt();beta[1] = cin.nextInt();beta[2] = cin.nextInt();(ii)for (j = 0; j < 3; j++)beta[j] = cin.nextInt();

Answers

Answer:

The answer is "Option (i) and (ii)".

Explanation:

In the given java code an integer array that is "beta" defines that contains 3 elements. To insert element in by user input we use scanner class object that is "cin". In the given question two options are defined that is used for inserting elements in array but there is a minor difference between them that can be described as:  

In option (i), To insert an element in array we use index value. It is time taking. In option (ii), In this option use a loop, inside a loop we write only one line, and this line inserts elements in array automatically.

The principal advantage of wireless technology is _____________ .

Answers

Answer:

The principal advantage of wireless technology is increased mobility.

Explanation:

The principal advantage is increased mobility, which means that you can access the network from wherever you are, as long you are in the network range.

For example, the wireless conection may be in the living room for example, and you may access the network from your bedroom, just a simple example.

So:

The principal advantage of wireless technology is increased mobility.

Address the FIXME comments. Move the respective code from the while-loop to the created function. The add_grade function has already been created.# FIXME: Create add_grade functiondef add_grade(student_grades):print('Entering grade. \n')name, grade = input(grade_prompt).split()student_grades[name] = grade# FIXME: Create delete_name function# FIXME: Create print_grades functionstudent_grades = {} # Create an empty dictgrade_prompt = "Enter name and grade (Ex. 'Bob A+'):\n"delete_prompt = "Enter name to delete:\n"menu_prompt = ("1. Add/modify student grade\n""2. Delete student grade\n""3. Print student grades\n""4. Quit\n\n")command = input(menu_prompt).lower().strip()while command != '4': # Exit when user enters '4'if command == '1':add_grade(student_grades)elif command == '2':# FIXME: Only call delete_name() hereprint('Deleting grade.\n')name = input(delete_prompt)del student_grades[name]elif command == '3':# FIXME: Only call print_grades() hereprint('Printing grades.\n') for name, grade in student_grades.items(): print(name, 'has a', grade) else: print('Unrecognized command.\n') command = input().lower().strip()

Answers

Answer:

The Python code is given below with appropriate comments

Explanation:

# FIXME: Create add_grade function

def add_grade(student_grades):

print('Entering grade. \n')

name, grade = input(grade_prompt).split()

student_grades[name] = grade

# FIXME: Create delete_name function

def delete_name(student_grades):

print('Deleting grade.\n')

name = input(delete_prompt)

del student_grades[name]

 

# FIXME: Create print_grades function

def print_grades(student_grades):

print('Printing grades.\n')    

for name, grade in student_grades.items():

print(name, 'has a', grade)

 

student_grades = {} # Create an empty dict

grade_prompt = "Enter name and grade (Ex. 'Bob A+'):\n"

delete_prompt = "Enter name to delete:\n"

menu_prompt = ("1. Add/modify student grade\n"

"2. Delete student grade\n"

"3. Print student grades\n"

"4. Quit\n\n")

command = input(menu_prompt).lower().strip()

while command != '4': # Exit when user enters '4'

if command == '1':

add_grade(student_grades)

elif command == '2':

# FIXME: Only call delete_name() here

delete_name(student_grades)

elif command == '3':

# FIXME: Only call print_grades() here

print_grades(student_grades)

else:

print('Unrecognized command.\n')

command = input().lower().strip()

The code updates involve creating the delete_name and print_grades functions and modifying the while-loop to call these functions when needed. The add_grade function is already defined and used for adding or modifying student grades. Ensuring these changes will improve code organization and readability.

To address the FIXME comments in the given code, we need to create three functions and move the respective operations from the while-loop into these functions. Here are the missing functions:

add_grade Function :

The add_grade function is already created, so we can move on to the next two functions.

delete_name Function :

We can define the delete_name function to handle deletion of student grades:

def delete_name(student_grades):
 print('Deleting grade. \n')
 name = input("Enter name to delete:\n")
 if name in student_grades:
   del student_grades[name]
 else:
   print(f'No student named {name} found.')

print_grades Function :

We can define the print_grades function to print all student grades:

def print_grades(student_grades):
 print('Printing grades.\n')
 for name, grade in student_grades.items():
   print(f'{name} has a {grade}')

Updated Code :

Now, update the while-loop to call these functions:

student_grades = {}  # Create an empty dict
grade_prompt = "Enter name and grade (Ex. 'Bob A+'):\n"
delete_prompt = "Enter name to delete:\n"
menu_prompt = ("1. Add/modify student grade\n" "2. Delete student grade\n" "3. Print student grades\n" "4. Quit\n\n")
command = input(menu_prompt).lower().strip()
while command != '4':  # Exit when user enters '4'
 if command == '1':
   add_grade(student_grades)
 elif command == '2':
   delete_name(student_grades)
 elif command == '3':
   print_grades(student_grades)
 else:
   print('Unrecognized command.\n')
 command = input().lower().strip()
Other Questions
A company has a $4,000, 270-day, 6%, note payable recorded on its books which was dated July 2, 2013. The interest expense is paid when the note matures. How much interest expense must be accrued on December 31, 2013, which is the end of the accounting period? Assume a 360-day year, use the exact number of days in your calculations, and round your answer to the closest penny. Which expression describes these arrays?3 x (3 x 2)2 x (3 x 2)2 + (3 x 2)ate WindowsPC settings to activate Wing What percentage of the mass of 1 mole of CH3Cl is derived from carbon? A function is represented by the values in the table.x y22 2620 2216 2014 1810 14The function represented in the table _________ linear.A. is notB. is Rowan has $50 in a savings jar and is putting in $5 every week. Jonah has $10 in his own jar and is putting in $15 every week. Each of them plots his progress on a graph with time on the horizontal axis and amount in the jar on the vertical axis. Which statement about their graphs is true?(1) Rowan's graph has a steeper slope than Jonah's.(2) Rowan's graph always lies above Jonah's.(3) Jonah's graph has a steeper slope than Rowan's.(4) Jonah's graph always lies above Rowan's. Part I: If Brad is 156 centimeters tall, how tall is he in inches?A. Create a conversion ratio that relates centimeters to inches. (Hint: 1 inch is approximately2.54 centimeters.) (2 points)B. Multiply the given number of centimeters by the conversion ratio you found in AShow your work. (2 points)C. Approximately how many feet tall is Brad? Round your answer to the nearest tenth of a footShow your work. (4 points)(Hint: Convert the number of inches found in B. to feet.)PLZZ HELP ITS FO APEX How do structural functionalists and conflict theorists approach race differently? Suppose the weights of seventhgraders at a certain school vary according to a Normal distribution, with a mean of 100 pounds and a standard deviation of 7.5 pounds. A researcher believes the average weight has decreased since the implementation of a new breakfast and lunch program at the school. She finds, in a random sample of 35 students, an average weight of 98 pounds. What is the P value for an appropriate hypothesis test of the researchers claim? In its first year of operations Acme Corp. had income before tax of $400,000. Acme made income tax payments totaling $150,000 during the year and has an income tax rate of 40%. What is the balance in income tax payable at the end of the year? What are some ways to prevent wildfires? In the late 1800s and early 1900s, what was the difference between "new" immigration and "old" immigration?"Old" immigrants were from western Europe, and "new" immigrants were from eastern and southern Europe."Old" immigrants were from eastern and southern Europe, and "new" immigrants were from western Europe."Old" immigrants were from Asia, and "new" immigrants were from South America."Old" immigrants were from South America, and "new" immigrants were from Africa. 5x2y=30Complete the missing value in the solution to the equation.(8,?) HELP!!!! Whats the length of a segment that begins at the point (4,7) and ends at the point (13,19)?A. 24B. 15C. 20D. 18 plz come on somebody After observing other children fighting on the playground, a young boy begins to pick a fight with one of his classmates. This scenario is most closely an example of: Intentionally making any false or materially inaccurate representation or comparison of two or more policies which induces any person to lapse, forfeit, surrender, or not take, a policy of insurance is known as:_________ heat energy on earth escapes into space . which heat transfer ? According to the VSEPR model, the progressive decrease in the bond angles in the series of molecules CH4, NH3, and H2O is best accounted for by the:_________ A newborn weighing 9 lb 14 oz (4479 g) is delivered by cesarean due to cephalopelvic disproportion. The Apgar scores are 7 at 1 minute and 9 at 5 minutes. Which nursing action should be taken after the initial physical assessment? What is the period of the function F(x) = 2 cot(3x-1) ? Steam Workshop Downloader