1answer.
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
Zigmanuir [339]
4 years ago
13

A developer has the following class and trigger code:public class InsuranceRates {public static final Decimal smokerCharge = 0.0

1;}trigger ContactTrigger on Contact (before insert) {InsuranceRates rates = new InsuranceRates();Decimal baseCost = XXX;}Which code segment should a developer insert at the XXX to set the baseCost variable to the value of the class variable smokerCharge?
A. Rates.smokerCharge
B. Rates.getSmokerCharge()
C. ContactTrigger.InsuranceRates.smokerCharge
D. InsuranceRates.smokerCharge
Computers and Technology
1 answer:
deff fn [24]4 years ago
4 0

Answer:

InsuranceRates.smokerCharge

Explanation:

To set the baseCost variable to the value of the class variable smokerCharge, the developer needs to replace

Decimal baseCost = XXX;

with

Decimal baseCost = InsuranceRates.smokerCharge;

This is done using the class reference type.

The smokerCharge should be declared in the InsuranceRates class, at first.

For example Ball b;

And then, a new instance of the object from the class is created, using the new keyword along with the class name: b = new Ball();

In comparing to the example I gave in the previous paragraph, the object reference in the program is:

InsuranceRates rates = new InsuranceRates();

Because the smokerCharge is coming from a different class, it can only be assigned to the variable baseCost via the InsuranceRates class to give:

Decimal baseCost = InsuranceRates.smokerCharge;

You might be interested in
Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal s
schepotkina [342]

Answer:

The area of the triangle is calculated as thus:

Area = 0.5 * b * h

To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;

Let s represent the slant height;

Dividing the triangle into 2 gives a right angled triangle;

The slant height, s is calculated using Pythagoras theorem as thus

s = \sqrt{b^2 + h^2}

The perimeter of the triangle is then calculated as thus;

Perimeter = s + s + b

Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b

Perimeter = 2\sqrt{b^2 + h^2} + b

For the volume of the cone,

when the triangle is spin, the base of the triangle forms the diameter of the cone;

Volume = \frac{1}{3} \pi * r^2 * h

Where r = \frac{1}{2} * diameter

So, r = \frac{1}{2}b

So, Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h

Base on the above illustrations, the program is as follows;

#include<iostream>

#include<cmath>

using namespace std;

void CalcArea(double b, double h)

{

//Calculate Area

double Area = 0.5 * b * h;

//Print Area

cout<<"Area = "<<Area<<endl;

}

void CalcPerimeter(double b, double h)

{

//Calculate Perimeter

double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;

//Print Perimeter

cout<<"Perimeter = "<<Perimeter<<endl;

}

void CalcVolume(double b, double h)

{

//Calculate Volume

double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;

//Print Volume

cout<<"Volume = "<<Volume<<endl;

}

int main()

{

double b, h;

//Prompt User for input

cout<<"Base: ";

cin>>b;

cout<<"Height: ";

cin>>h;

//Call CalcVolume function

CalcVolume(b,h);

//Call CalcArea function

CalcArea(b,h);

//Call CalcPerimeter function

CalcPerimeter(b,h);

 

return 0;

}

3 0
3 years ago
i was playing a mobile game and I was a guild leader in there. one of the members were very disrespectful and they just left bec
Sonbull [250]

Answer:

which mobile game? Whatever the worst thing you can do is. If its slurs and harassment or bullying report them

Explanation:

3 0
3 years ago
Read 2 more answers
NEED FIVE QUESTIONS ANSWERED!!! take your time~
DochEvi [55]
  1. A
  2. C
  3. C
  4. B
  5. A

I'M NOT 100% SURE i hope this helps you

4 0
3 years ago
Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
max2010maxim [7]

Answer:

budget=455

shopping_list=("codelab", "textbook", "ipod", "cd", "bike")

prices={"codelab":300, "textbook":100,"ipod":50, "cd":10, "bike":600}

number_of_items=0

sum=0

for index in range(len(shopping_list)):

   sum=sum+prices[shopping_list[index]]

   if (sum<=budget):

       number_of_items=number_of_items+1

   else :

       break

print "number of items you can purchase, for a budget of",budget,"is",number_of_items

Explanation:

A code to determine the number of items that can be purchased is above, given the value associated with budget, and given that you will buy items in the order that they appear in the tuple associated with shopping_list.

4 0
3 years ago
What is computer software
Butoxors [25]
A set of instructions and documents that tells a computer what to do or how to perform a task or it can mean all the software on a computer,
7 0
3 years ago
Read 2 more answers
Other questions:
  • Don is the superintendent of the county school system. What task might Don
    8·1 answer
  • ____ map a set of alphanumeric characters and special symbols to a sequence of numeric values that a computer can process.
    14·1 answer
  • Web services can exchange information between two different systems only if the operating systems and programming languages upon
    10·1 answer
  • 1. When centering one paragraph on a page of text, the user needs to _____.
    15·2 answers
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • Selena needs to insert a comment in a webpage's code to ensure that other web team members who work with the page code understan
    15·1 answer
  • During project management, who executes tasks and produces the deliverables as stated in the project plan and as directed by the
    9·1 answer
  • 9.4 Code Practice: Your task is to determine whether each item in the array above is divisible
    14·1 answer
  • This is an image of the ...........................Topology.
    5·1 answer
  • you're troubleshooting an ip addressing issue, and you issue a command to view the system's tcp/ip configuration. the command yo
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!