answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TEA [102]
2 years ago
15

When you use a while loop to compute the product of several values, you should initialize the variables holding the product to _

_____ .
a. 0

b. 1

c. NULL

d. there is no need to initalize it
Computers and Technology
1 answer:
Allushta [10]2 years ago
3 0

Answer:

b.1

Explanation:

When we are using while loop to compute the product of several values we need to initialize the value holding the product to 1 because when we multiply something with 1 it will give the same number.

If we initialize it with 0 the product will come out to be 0 because  anything multiplied by 0 is 0.

we cannot initialize it with NULL because it is not a pointer.

We need to initialize the number since it contains garbage values so it will give product with that value.

You might be interested in
my headphones have a mic and the mic and headset don't work at the same time what do i do to make them work together
JulsSmile [24]
Return them they are probably defective or turn ur media volume all the way down.
6 0
2 years ago
Read 2 more answers
A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
muminat

The code below is used to determine a recursive, bool-valued function, isPalindrome, that accepts an integer-valued array, and the number of elements and returns whether the array is a palindrome.

Explanation:

  • The code shows 'array palindrome' is an array which, when its elements are reversed, remains the same.

bool isPalindrome(arr[((n-1) - n) +1], n)

{

   if (n == 0 || n == 1)

   {

       return true;

   }

   else if (arr[n-1] == isPalindrome(arr[], n-1)

   {

       return true;

   }  

   else {

       return false;

   }

}

5 0
2 years ago
A company wants to inform a select list of it's regular customers about a flash sale. Which type of platform will it use to send
blondinia [14]
<h2>Answer :</h2>

In case of Flash Sale, usually company uses Instant messages or SMS. As there are chances customer in most of the cases don’t have access to their emails due to internet unavailability. However SMS can be directed towards customers without the requirements of an internet. In case of SMS, there are companies available that can shoot out targeted SMS based on cities or even an entire country at a very minimal price. Company can provided them there contacts as well as they have a list of numbers from different sources to which they can send instant messages.


5 0
2 years ago
Ted knows that macros can be helpful to him in his work with Excel spreadsheets,but he also knows they have their hazards,so he
laila [671]

Answer:

Hhhhhhhhjjjffhkvs4hjtth

Explanation:

H*jhfujttjhfhjfhhdtjdgndrjgr7kvykngimg6

3 0
2 years ago
(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping o
lys-0071 [83]

Answer:

Check the explanation

Explanation:

note: code is implemented as per the main method provided:

code:

using System;

public class Package

{

string senderName11;

string senderAddress1;

string senderCity1;

string senderState1;

string senderZip1;

string recipientName1;

string recipientAddress1;

string recipientCity1;

string recipientState1;

string recipientZip1;

decimal weight1;

decimal costPerOunce1;

public string SenderName11

{

get { return senderName11; }

set { senderName11 = value; }

}

public string SenderAddress1

{

get { return senderAddress1; }

set { senderAddress1 = value; }

}

public string SenderCity1

{

get { return senderCity1; }

set { senderCity1 = value; }

}

public string SenderState1

{

get { return senderState1; }

set { senderState1 = value; }

}

public string SenderZip1

{

get { return senderZip1;}

set { senderZip1 = value; }

}

public string RecipientName1

{

get { return recipientName1; }

set { recipientName1 = value; }

}

public string RecipientAddress1

{

get { return recipientAddress1; }

set { recipientAddress1 = value; }

}

public string RecipientCity1

{

get { return recipientCity1; }

set { recipientCity1 = value; }

}

public string RecipientState1

{

get { return recipientState1; }

set { recipientState1 = value; }

}

public string RecipientZip1

{

get { return recipientZip1; }

  set { recipientZip1 = value; }

}

public decimal Weight1

{

get { return weight1; }

set

{

if (value > 0)

weight1 = value;

else

Console.WriteLine("Weight1 can't be less tha zero");

}

}

public decimal CostPerOunce1

{

get { return costPerOunce1; }

set

{

if (value > 0)

costPerOunce1 = value;

else

Console.WriteLine("Cost per ounce can't be less than zero");

)

{

SenderName11 = senderName11;

SenderAddress1 = senderAddress1;

)

{

TwoDayDeliveryFee = twoDayDeliveryFee;

}

public override decimal CalculateCost()

{

return base.CalculateCost() + TwoDayDeliveryFee;

}

OvernightDeliveryFeePerOunce = overnightDeliveryFeePerOunce;

}

public override decimal CalculateCost()

{

return (CostPerOunce1 + OvernightDeliveryFeePerOunce) * Weight1;

}

}

class TestPackages

{

static void Main(string[] args)

{

Package regularPackage = new Package

(

"Peter Anderson",

"123 Main St, Ashville, NC 27111 ",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St Benson, NC 27222",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M

);

Console.WriteLine("\nRegular Package: ");

  Console.WriteLine(" Sender's Name: {0}",

      regularPackage.SenderName11);

  Console.WriteLine(" Sender's Address: {0}",

      regularPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

       regularPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

       regularPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}"

, regularPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

       regularPackage.CostPerOunce1);

  Console.WriteLine("Shipping Cost: {0:C}",

       regularPackage.CalculateCost());

Console.WriteLine(regularPackage.CalculateCost());

 

TwoDayPackage twoDayPackage = new TwoDayPackage

(

"Peter Anderson",

"123 Main St 123 Main St, Ashville, NC 27111",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M,

1.5M

);

  Console.WriteLine("\nTwo-Day Package: ");

  Console.WriteLine(" Sender's Name: {0}",

  twoDayPackage.SenderName11);

Console.WriteLine(" Sender's Address: {0}",

twoDayPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

   twoDayPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

   twoDayPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}", twoDayPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

   twoDayPackage.CostPerOunce1);

  Console.WriteLine(" Flat Fee: {0:C}",

   twoDayPackage.Weight1);

  Console.WriteLine(" Shipping Cost: {0:C}",

   twoDayPackage.CalculateCost());

OvernightPackage overnightPackage = new OvernightPackage

(

"Peter Anderson",

"123 Main St 123 Main St, Ashville, NC 27111",

"Ashville",

"NC 27111",

"MN 55416",

"Mary Brown",

"456 Broad St Benson, NC 27222",

"St. Petersburg",

"Benson",

"NC 27222",

160M,

0.1M,

1.5M

);

Console.WriteLine("\nOvernight Package: ");

  Console.WriteLine(" Sender's Name: {0}",

   overnightPackage.SenderName11);

  Console.WriteLine(" Sender's Address: {0}",

   overnightPackage.SenderAddress1);

  Console.WriteLine(" Recipient's Name: {0}",

   overnightPackage.RecipientName1);

  Console.WriteLine(" Recipient's Address: {0}",

   overnightPackage.RecipientAddress1);

  Console.WriteLine(" Weight1: {0}",

   overnightPackage.Weight1);

  Console.WriteLine(" Cost Per Ounce: {0:C}",

   overnightPackage.CostPerOunce1);

  Console.WriteLine(" Additional Cost Per Ounce: {0:C}",

   overnightPackage.OvernightDeliveryFeePerOunce);

  Console.WriteLine(" Shipping Cost: {0:C}",

   overnightPackage.CalculateCost());

Console.WriteLine(overnightPackage.CalculateCost()); Console.ReadKey();

}

}

The Result can be seen below:

8 0
2 years ago
Other questions:
  • Darcy is creating an instructional manual for her employees. She entered the text in a word processing program and wants to impo
    6·1 answer
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
    15·1 answer
  • A client is asking for a printing solution that will print three sheets of paper with identical information on each page with a
    13·1 answer
  • Using the RAID controller on the motherboard, you configure three hard disks in a RAID 5 array. You leave the array unpartitione
    14·1 answer
  • Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
    7·1 answer
  • Consider a one-way authentication technique based on asymmetric encryption: A --&gt; B: IDA B --&gt; A: R1 A --&gt; B: E(PRa, R1
    13·1 answer
  • Consider the following two code segments, which are both intended to determine the longest of the three strings "pea", "pear", a
    7·1 answer
  • A company has offices in Honolulu, Seattle, Ogden, and Dublin, Ireland. There are transmission links between Honolulu and Seattl
    10·1 answer
  • Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!