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
Nimfa-mama [501]
3 years ago
14

For C++ (please make sure it runs properly)

Computers and Technology
1 answer:
Jlenok [28]3 years ago
7 0

Answer:

The C code is below.

Explanation:

#define amplitude 1

02     #define b 1

03     #define c 200

04     class Sinewave

05     {

06     protected:

07

08                 double freq;

09                 int y;

10

11     public:

12                 Sinewave()

13                 {

14

15                 }              

16                 void generateSinewave()

17                 {

18                     COLORREF yellow = RGB(255,255,0);

19                     COLORREF lightblue = RGB(173,216,230);

20

21                     // make sure the names match

22                     SetConsoleTitle(L"ConGraphics");

23                     HWND hWnd = FindWindow(NULL, L"ConGraphics");

24                     HDC hDC = GetDC(hWnd);

25

26                     //for(int x = 0; x < freq; x++)

27                     for(int x = 0;; x++)

28                     {

29                         // center at y = 200 pixels

30                          

31                         y = amplitude*(int)(sin(x/100.0)*100 + 150);

32                         SetPixel(hDC, x, y, lightblue);

33                          

34                          

35                     }

36                      

37                 }

38 };

You might be interested in
EASY QUESTION EASY POINTS!!!!! WILL MARK BRAINLIEST!!!!!
TEA [102]

The program is an illustration of loops and conditional statements

<h3>Loops</h3>

Loops are used to perform repetitive operations.

<h3>Conditional statement</h3>

Conditional statements are used to make decisions

<h3>The python program</h3>

The program in Python, where comments are used to explain each line is as follows.

#The following is repeated 5 times; i.e. the rows

for i in range(5):

   #The following is repeated 5 times; i.e. the columns

   for j in range(5):

       #For rows 2 and 5

       if i == 1 or i== 3:

           #For columns 1 and 5

           if j == 0 or j == 4:

               #This prints *

               print('*',end='')

           #For other columns

           else:

               #This prints an empty space

               print('',end=' ')

       #For other rows

       else:

           #This prints *

           print('*',end='')

   #This prints a new line

   print()

Read more about loops at:

brainly.com/question/19344465

5 0
2 years ago
HEEEEELPPP!!!BRAINLIEST!!! THIS IS URGENT!!!
Fittoniya [83]

Answer:

Begin the statement with the proper keyword to start the loop

Explanation:

Given

The code segment

Required

Fix the code

The first line of the code segment is meant to be a for loop, but it does follow the right syntax.

This is so because the for keyword is missing.

The first line should be corrected and replaced with:

for count in range(80):

Hence, option (b) is correct

4 0
2 years ago
What can you say about the following Java class definition?
IrinaK [193]

Answer:

The class is called MyApp which inherits from JFrame and implements the ActionListener interface.

Explanation:

The class is called MyApp which extends the swing class JFrame and implements the ActionListener interface for event handling. As a results it needs to implement a method called actionPerformed for handling the relevant events that may be raised from the user interface. Since it extends JFrame, it has access to all the public and protected methods defined in JFrame(for example setTitle to set the title of the frame).

3 0
3 years ago
What is a functionalist perspective of cell phones, internet and personal computers?
Sedbober [7]
<span>As these technologies are rapidly evolving a functionalist would say that they unbalance the equilibrium of the social state, and is therefore undesirable as there is more interaction and adaptation of habits from other societies. But they also say that it's not a good thing to change immediately because it might disrupt the society. Therefore it has to change slowly. </span>
3 0
3 years ago
Can someone help me with these questions?
REY [17]

website will be the first, hyperlink will be the second, A will be number three, and webpage will be number 4

8 0
3 years ago
Other questions:
  • When sociologists say that it is difficult to predict all the results of social change, what are they referring to?
    5·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • show how one version of the technology is an improvement over a previous iteration of that same technology
    11·1 answer
  • When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when
    12·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    6·1 answer
  • Illustrate that the system is in a safe state by demonstrating an order in which the threads may complete.If a request from thre
    7·1 answer
  • What is Gpu in simple terms ​
    11·2 answers
  • What are the pros and cons of using ICT​
    13·1 answer
  • Do anyone know how to code like I need someone do a code for me?
    13·1 answer
  • Array bounds checking should be directly coded into a system rather than assumed.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!