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]
2 years ago
14

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

Computers and Technology
1 answer:
Jlenok [28]2 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
Will give brainliest!!!!!!!!
dolphi86 [110]

Answer:

d the overall strength of colours

Explanation:

7 0
3 years ago
Read 2 more answers
Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
xz_007 [3.2K]

Answer:

C.

Explanation:

8 0
2 years ago
Design a class that has an array of floating-point numbers. The constructor should accept an integer argument and dynamically al
attashe74 [19]

Answer:

See explaination for the code

Explanation:

Here is the code

class NumberArray

{

private:

float *aptr; // Pointer to the array

int arraySize; // Holds the array size

float max,min,avg;

public:

NumberArray(int); // Constructor

~NumberArray(); // Destructor

int size() const // Returns the array size

{ return arraySize; }

void storeNumber(float num,int ele);

float retrieveNumber(int ele);

float getHighest();

float getLowest();

float getAverage();

};

//*******************************************************

// Constructor for IntArray class. Sets the size of the *

// array and allocates memory for it. *

//*******************************************************

NumberArray::NumberArray(int s)

{

arraySize = s;

aptr = new float [s];

for (int count = 0; count < arraySize; count++)

*(aptr + count) = 0;

}

//******************************************************

// Destructor for IntArray class. *

//******************************************************

NumberArray::~NumberArray()

{

if (arraySize > 0)

delete [] aptr;

}

void NumberArray::storeNumber(float num,int ele)

{

if(ele<arraySize)

*(aptr+ele)=num;

}

float NumberArray::retrieveNumber(int ele)

{

return *(aptr+ele);

}

float NumberArray::getHighest()

{

float high=*(aptr+0);

for(int i=1;i<arraySize;i++)

if(high<*(aptr+i))

high=*(aptr+i);

return high;

}

float NumberArray::getLowest()

{

float low=*(aptr+0);

for(int i=1;i<arraySize;i++)

if(low>*(aptr+i))

low=*(aptr+i);

return low;

}

float NumberArray:: getAverage()

{

float ag=0;

for(int i=1;i<arraySize;i++)

ag+=*(aptr+i);

ag=ag/arraySize;

return ag;

}

//Header file section

#include <iostream>

using namespace std;

int main()

{

const int SIZE = 10; // Array size

// Define an IntArray with 10 elements.

NumberArray table(SIZE);

//function call to store values

table.storeNumber(1,0);

table.storeNumber(3,1);

table.storeNumber(7,2);

table.storeNumber(2,3);

//display values

cout<<"Highest value:"<<table.getHighest()<<endl;

cout<<"Lowest Value:"<<table.getLowest()<<endl;

cout<<"Average:"<<table.getAverage()<<endl;

///pause system for a while

system("pause");

return 0;

}

6 0
2 years ago
Generally speaking, the _______ the risk, the _______ the potential return or loss
givi [52]
<span>The correct answer is higher for both blank spaces.

We all know the famous saying: "No risk, no reward". What is true is the higher your risk you also have a higher degree of reaping a higher rewards. But the opposite is also true, the more you risk the more you stand to lose. In stockbroker business this is best exemplified, as you can se brokers trying to predict the stock market in order to make greater profits. Gambling is also the good example of this. </span>
6 0
2 years ago
Read 2 more answers
98 points possible
joja [24]

A programming language is not used to talk from human to human. It is used to talk from a human to a computer. Computers are very dumb compared to us, so they need to be taught or spoken to in simple terms. Asking them something complex is far beyond their understanding, as they cannot learn anything beyond what has already been taught to them. Using print: “Hello, World” is the way to tell them to do stuff way less complex than when we say ‘write the words Hello, World on the screen’. A programming language is also not very easy to create. Talking to a computer in a dumb way reduces the process to make a new language for the computer to understand.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • Ports on the motherboard can be disabled or enabled in ____ setup. RAM Firmware Northbridge BIOS
    8·1 answer
  • Which type of address defines a single network interface in a computer or other device?
    7·1 answer
  • Electricity was seen as a mysterious force and began to creat a stir when people called​
    13·1 answer
  • If you want to open an application that does not have a tile pinned to the Start menu, _____ to find it in the list of installed
    7·1 answer
  • Which best describes a difference between transcription and DNA replication
    8·2 answers
  • What is the definition of posture<br>​
    7·1 answer
  • Complete the following sentence.
    7·1 answer
  • Limitations of systems analysis and design​
    13·1 answer
  • If I want to make it look like slide number one is turning a page to slide number two, what
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!