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
Yakvenalex [24]
3 years ago
9

Create a class Circle with one instance variable of type double called radius. Then define an appropriate constructor that takes

an initial value for the radius, get and set methods for the radius, and methods getArea and getPerimeter.
Computers and Technology
1 answer:
Mrrafil [7]3 years ago
4 0

public class Circle {

// the private data members

private double radius;

private double area;

private double diameter;

public void setRadius(double r)

{

 radius = r;

}

public double getRadius()

{

 return radius;

}

public double computeDiameter()

{

 return radius * 2;

}

public double computeArea()

{

 return ((radius * radius) * 3.14);

}

}

You might be interested in
Mrs. Jackson wrote a newsletter to the customers of her housecleaning business that included some organizational tips they could
nika2105 [10]
The correct answer is a. effective communication

- - -
Ineffective and barriers to communication are problems that make communication unclear. Workplace communication is at work or at a job. This is not a job newsletter for workers, but for people at home.
5 0
3 years ago
Read 2 more answers
Make a webpage that shows news <br>​
Nataly_w [17]
Well it all depends how you plan on making it as you would need to know Web Development or you could just copy paste code from YT
8 0
2 years ago
The Moon appears to be red in color during a total lunar eclipse because of the way light waves pass through Earth’s ___________
Marysya12 [62]

Answer bro must have a mental disorder its like ur thumb HEAT WAVES the  moon becomes red bc of heat waves didnt u say that anyways???

Explanation:

8 0
1 year ago
Read 2 more answers
a cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits such that the giv
Leokris [45]

Using the knowledge in computational language in C++ it is possible to write a code that  cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits

<h3>Writting the code:</h3>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em>// chracter to digit mapping, and the inverse</em>

<em>// (if you want better performance: use array instead of unordered_map)</em>

<em>unordered_map<char, int> c2i;</em>

<em>unordered_map<int, char> i2c;</em>

<em>int ans = 0;</em>

<em>// limit: length of result</em>

<em>int limit = 0;</em>

<em>// digit: index of digit in a word, widx: index of a word in word list, sum: summation of all word[digit]  </em>

<em>bool helper(vector<string>& words, string& result, int digit, int widx, int sum) { </em>

<em>    if (digit == limit) {</em>

<em>        ans += (sum == 0);</em>

<em>        return sum == 0;</em>

<em>    }</em>

<em>    // if summation at digit position complete, validate it with result[digit].</em>

<em>    if (widx == words.size()) {</em>

<em>        if (c2i.count(result[digit]) == 0 && i2c.count(sum%10) == 0) {</em>

<em>            if (sum%10 == 0 && digit+1 == limit) // Avoid leading zero in result</em>

<em>                return false;</em>

<em>            c2i[result[digit]] = sum % 10;</em>

<em>            i2c[sum%10] = result[digit];</em>

<em>            bool tmp = helper(words, result, digit+1, 0, sum/10);</em>

<em>            c2i.erase(result[digit]);</em>

<em>            i2c.erase(sum%10);</em>

<em>            ans += tmp;</em>

<em>            return tmp;</em>

<em>        } else if (c2i.count(result[digit]) && c2i[result[digit]] == sum % 10){</em>

<em>            if (digit + 1 == limit && 0 == c2i[result[digit]]) {</em>

<em>                return false;</em>

<em>            }</em>

<em>            return helper(words, result, digit+1, 0, sum/10);</em>

<em>        } else {</em>

<em>            return false;</em>

<em>        }</em>

<em>    }</em>

<em>    // if word[widx] length less than digit, ignore and go to next word</em>

<em>    if (digit >= words[widx].length()) {</em>

<em>        return helper(words, result, digit, widx+1, sum);</em>

<em>    }</em>

<em>    // if word[widx][digit] already mapped to a value</em>

<em>    if (c2i.count(words[widx][digit])) {</em>

<em>        if (digit+1 == words[widx].length() && words[widx].length() > 1 && c2i[words[widx][digit]] == 0) </em>

<em>            return false;</em>

<em>        return helper(words, result, digit, widx+1, sum+c2i[words[widx][digit]]);</em>

<em>    }</em>

<em>    // if word[widx][digit] not mapped to a value yet</em>

<em>    for (int i = 0; i < 10; i++) {</em>

<em>        if (digit+1 == words[widx].length() && i == 0 && words[widx].length() > 1) continue;</em>

<em>        if (i2c.count(i)) continue;</em>

<em>        c2i[words[widx][digit]] = i;</em>

<em>        i2c[i] = words[widx][digit];</em>

<em>        bool tmp = helper(words, result, digit, widx+1, sum+i);</em>

<em>        c2i.erase(words[widx][digit]);</em>

<em>        i2c.erase(i);</em>

<em>    }</em>

<em>    return false;</em>

<em>}</em>

<em>void isSolvable(vector<string>& words, string result) {</em>

<em>    limit = result.length();</em>

<em>    for (auto &w: words) </em>

<em>        if (w.length() > limit) </em>

<em>            return;</em>

<em>    for (auto&w:words) </em>

<em>        reverse(w.begin(), w.end());</em>

<em>    reverse(result.begin(), result.end());</em>

<em>    int aa = helper(words, result, 0, 0, 0);</em>

<em>}</em>

<em />

<em>int main()</em>

<em>{</em>

<em>    ans = 0;</em>

<em>    vector<string> words={"GREEN" , "BLUE"} ;</em>

<em>    string result = "BLACK";</em>

<em>    isSolvable(words, result);</em>

<em>    cout << ans << "\n";</em>

<em>    return 0;</em>

<em>}</em>

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

#SPJ1

3 0
1 year ago
________ and wpa are wireless security protocols which use encryption to secure wi_fi networks.
ra1l [238]
Im pretty sure its WEP :)
7 0
3 years ago
Other questions:
  • True/False: If a function is legally prototyped to return an integer value, it can return a structure member that is an integer
    11·1 answer
  • What kind of problems could you run into if you format a cell with the wrong format for the data type?
    15·2 answers
  • According to which virtue do you need to secure information by limiting computer access to authorized personnel only ?
    13·2 answers
  • Computing devices translate digital to analog information in order to process the information
    8·1 answer
  • Select the correct answer.
    15·1 answer
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • Which symbol is at the beginning and end of a multiline comment block? ### &amp;&amp;&amp; %%% """
    14·1 answer
  • Develop Swimlane Activity diagram for Assignment announcement and submission system.
    6·1 answer
  • Write a program that accepts the lengths of three sides of a triangle as inputs. the program output should indicate whether or n
    15·1 answer
  • What is used for risk response control?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!