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
Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of in
MAXImum [283]

Answer:

B. {1, 2, 2, 3, 3, 4, 5}

Explanation:

Given

The above code segment

Required

Determine which list does not work

The list that didn't work is B.\ \{1, 2, 2, 3, 3, 4, 5\}

Considering options (A) to (E), we notice that only list B has consecutive duplicate numbers i.e. 2,2 and 3,3

All other list do not have consecutive duplicate numbers

Option B can be represented as:

nums[0] = 1

nums[1] = 2

nums[2] = 2

nums[3] = 3

nums[4] = 3

nums[5] = 4

nums[6] = 5

if (nums.get(j).equals(nums.get(j + 1)))

The above if condition checks for duplicate numbers.

In (B), when the elements at index 1 and 2 (i.e. 2 and 2) are compared, one of the 2's is removed and the Arraylist becomes:

nums[0] = 1

nums[1] = 2

nums[2] = 3

nums[3] = 3

nums[4] = 4

nums[5] = 5

The next comparison is: index 3 and 4. Meaning that comparison of index 2 and 3 has been skipped.

<em>This is so because of the way the if statement is constructed.</em>

3 0
3 years ago
I neeeeed a girl that is looking for true love, trust me i will love her
nignag [31]

Answer:

sure!

Explanation:

4 0
2 years ago
Read 2 more answers
PI
siniylev [52]

Explanation:

As the qn was copy pasted from another document...the qn seems incorrect... and incomplete..

pls see to it and attach the correct qn...

sorry

4 0
2 years ago
Which of these are part of the CPU?<br> O peripheral<br> O HDMI cord<br> O core<br> O keyboard
Makovka662 [10]
Hiii I think the best option would be C. Core
7 0
3 years ago
Choose the correct color to complete the sentence.
Serga [27]

Answer:blue is the best color choice for a global audience.

3 0
3 years ago
Other questions:
  • SELECT vendor_name, COUNT(*) AS number_of_invoices, MAX(invoice_total - payment_total - credit_total) AS balance_due FROM vendor
    15·1 answer
  • Password procedures, information encryption software, and firewalls are examples of measures taken to address:
    13·1 answer
  • Lisa granted the CREATE TABLE privilege WITH ADMIN OPTION to Sharon. Sharon granted the privilege to Bob. If Lisa’s privileges a
    13·1 answer
  • Joshua takes ownership of all his tasks. Which quality is he demonstrating?
    9·2 answers
  • Identical objects are placed in Beaker A and in Beaker B. The objects float as shown in the diagrams below. What can you conclud
    9·1 answer
  • Cameron oversees inventory tracking in her school store. Which feature in a database allows her to organize the items from highe
    6·1 answer
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • Write a program that deliberately contains an endless or infinite while loop. The loop should generate multiplication questions
    13·1 answer
  • When a company sends you recommendations of what to buy you know that :
    12·1 answer
  • When it comes to credit scores, why is having a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!