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
creativ13 [48]
3 years ago
13

Write a program to draw a text-based graph of a mathematical function f(x)

Computers and Technology
1 answer:
Makovka662 [10]3 years ago
4 0
I have a very good example of the program you need written on Python. You can use this (sorry for bad tabulation):
import math import math def main(): function = input("Enter a function f(x):\n") x = 0 y = 0 for rows in range(10,-11,-1): for col in range(-10,11,1): x=col roundfx = round(eval(function)) if roundfx == rows: print("o", end="") if rows==0 and col==0 and not rows == roundfx: print("+", end="") if col == 0 and not rows == 0 and not rows == roundfx: print("|", end="") if rows==0 and not col==0 and not rows == roundfx: print("-", end="") else: if not rows == 0: if not col == 0: if not rows == roundfx: print(" ", end="") print() main()
You might be interested in
How do i code........​
wlad13 [49]

Explanation:

What code are you talking about?

4 0
2 years ago
Read 2 more answers
Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 3
BARSIC [14]

Answer:

public class Rectangle {

   private double width;

   private double heigth;

   public Rectangle(double width, double heigth) {

       this.width = width;

       this.heigth = heigth;

   }

   public double getWidth() {

       return width;

   }

   public void setWidth(double width) {

       this.width = width;

   }

   public double getHeigth() {

       return heigth;

   }

   public void setHeigth(double heigth) {

       this.heigth = heigth;

   }

   public double perimeter(double width, double heigth){

       double peri = 2*(width+heigth);

       return peri;

   }

   public double area(double width, double heigth){

       double area = width*heigth;

       return  area;

   }

}

class RectangleTest{

   public static void main(String[] args) {

       //Creating two Rectangle objects

       Rectangle rectangle1 = new Rectangle(4,40);

       Rectangle rectangle2 = new Rectangle(3.5, 35.7);

       //Calling methods on the first Rectangel objects

       System.out.println("The Height of Rectangle 1 is: "+rectangle1.getHeigth());

       System.out.println("The Width of Rectangle 1 is: "+rectangle1.getWidth());

       System.out.println("The Perimeter of Rectangle 1 is: "+rectangle1.perimeter(4,40));

       System.out.println("The Area of Rectangle 1 is: "+rectangle1.area(4,40));

       // Second Rectangle object

       System.out.println("The Height of Rectangle 2 is: "+rectangle2.getHeigth());

       System.out.println("The Width of Rectangle 2 is: "+rectangle2.getWidth());

       System.out.println("The Perimeter of Rectangle 2 is: "+rectangle2.perimeter(4,40));

       System.out.println("The Area of Rectangle 2 is: "+rectangle2.area(4,40));

   }

}

Explanation:

  • Firstly A Rectangle class is created with two fields for width and heigth, a constructor and getters and setters the class also has methods for finding area and perimeters
  • Then a RectangleTest class containing a main method is created and two Rectangle objects are created (Follow teh comments in the code)
  • Methods to get height, width, area and perimeter are called on each rectangle object to print the appropriate value
5 0
2 years ago
A security system uses sensors at every door and window which will set off an alarm if any one of them is opened. There is also
jeka57 [31]
Well think of it like this lets say this wasn't and security system and it was a video game console and remote.
 Now the console or keypad or the main components the power on or shut off the devices and the remote or sensors are the secondary parts but they are needed to help the console or keypad figure out what they are doing.
5 0
3 years ago
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
2 years ago
Which one of these components is a part of the central processing unit (cpu)of a computer
katovenus [111]

Answer:

Control Unit

Explanation:

4 0
3 years ago
Other questions:
  • Give me give me keyboard on this phone please provide nice I can't type where is the keyboard.Give me give me keyboard on this p
    6·2 answers
  • Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records a
    12·1 answer
  • What is the smallest unit of data on the hard drive?
    5·1 answer
  • Develop a list of privacy protection features that should be present if a website is serious about protecting privacy. Then, vis
    8·1 answer
  • Write the contrapositive of each of the following statements. Healthy plant growth follows from sufficient water. Increased avai
    7·1 answer
  • What will you see on the next line?
    6·2 answers
  • Write a java program to find the perimeter of a triangle with sides measuring 10cm, 14cm and 15 cm.
    8·1 answer
  • Define Agricultural Era
    14·2 answers
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
  • Rr lyrae stars pulsate, but with shorter periods and lower luminosities than cepheids. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!