answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Write a program in C to find the complex number of a given number?

There is no such thing; you seem to have misunderstood something.

Any real number can be regarded as a complex number with zero imaginary part, eg.: 5 = 5+0i

For math what is mean?

The mathematical mean (average) is where you add up all of the inputs and divide by the total number of inputs. Mean -- mathematical average. Mode -- most common member of a set. Median -- middle of a set or group.

How do you create a hexagon that when you move the points the angles don't change on GSP?

I'm not familiar with GSP, but if you move any vertex of a hexagon then it is no longer a hexagon. In order to maintain the shape (that is, the aspect ratio) you must move all vertices at the same time, relative to the centre of the hexagon.

The easiest way to calculate where each vertex should be placed is to imagine the hexagon is circumscribed with a circle such that all the vertices touch the circle. Thus the centre of the circle is also the centre of the hexagon. So when you move any vertex, you are essentially increasing or decreasing the radius of the circle and/or rotating the circle around its centre. However, the centre never moves so you only need to know the horizontal and vertical distance of the vertex you moved relative to the centre of the circle, and Pythagoras' Theorem tells you the radius of the circle (X2 + Y2 = Z2), and thus you can determine the angle of the hypotenuse relative to the horizontal or vertical plane. Knowing the position of one vertex means you can work out all 6 vertices (hint: they are 60 degrees apart).

How to get transcripts from the Computer Learning center?

To obtain transcripts from the Computer Learning Center, you typically need to submit a formal request to the institution's registrar or academic records office. This request may require specific information such as your full name, student ID number, dates of attendance, and the address where the transcripts should be sent. There may also be a processing fee associated with this request. It's essential to follow the center's procedures carefully to ensure a smooth and timely transcript retrieval process.

Disadvantages of input devices?

Input Devices provide input signals to Computing devices. There can be disadvantages for a particular type of Input Device such as Mouse, Keyboard, Pointers etc.

Nonetheless without Input devices Computer might not be able to receive information & remain useless.

What is multimedia highway?

when multimedia owners gain information about the worth of their product they need to sell their product so they sell their product online as distributed resources on the data highway(like a road highway toll) where the customer or user needs to pay money in order to use the service or acquire the content.

various elements like videos, sound, images an other interactive contents are shared over the highway.

What are the disadvantages of basic programming?

Disadvantages:

you would have to learn a powerful coding language, which might take a lot of time. you would have to choose out of the popular coding languages, e.g. Java, C++, C#, C, Python, etc, etc. It would take a LONG time to write the actual program.

Advantages:

you could profit on it, depending on how good or bad your program is. you would be praised on your knowledge of coding languages.

How is statistics applied in the educational sector?

Statistics is widely applied in the educational sector to analyze data and improve decision-making processes. It helps educators and policymakers assess student performance, identify learning gaps, and measure the effectiveness of teaching methods and programs. Through statistical analysis, trends in student achievement can be tracked, allowing for targeted interventions and resource allocation. Furthermore, statistics enable educational institutions to conduct research on curriculum effectiveness, student retention rates, and overall institutional performance. By utilizing statistical data, schools and universities can make data-driven decisions that enhance learning outcomes and improve educational quality.

Write shell script to print prime numbers in a given range?

echo enter a range

read rng

echo 2

j=3

while test $j -le $rng

do

i=2

x=`expr $j - 1`

while test $i -le $x

do

if [ `expr $j % $i` -ne 0 ]

then

i=`expr $i + 1`

else

break

fi

done

if [ $i -eq $j ]

then

echo $j

fi

j=`expr $j + 1`

done

What is the binary code for 53?

Divide 54 by 2. Use the integer quotient obtained in this step as the dividend for the next step. Repeat the process until the quotient becomes 0.

So we get answer 110110

How ed problem can be solve advise treatment?

ED can be treated with medications such as tadalafil. Moreover, try to know the underlying causes of your ED problems so you can have approrpiate treatments. For example, some men suffer ED because of diabetes or hypertension. But you should not worry since ED can be treated. Check this link for more info about ED treatments: http://www.tadalafil-20-mg.biz/erectile-dysfunction-info

Definition of email security?

Email security refers to the collective measures taken to secure the access of the content of a given email service or account.

What are the main features of a compiler in C programming language?

A compiler is a comp. Program that transforms source code written in programming language into another comp. Language.the main reason to compile a program is to create an executable program...

What is the difference between clearing a cell and deleting the contects of a cell?

You're mixing up terminologies here. A cell can be cleared or deleted.

When we delete a cell, the cell is physically removed from the table. The cells in the same row or column then slide into its place depending on which option we choose (shift up or slide left).

When we clear a cell we remove the cell's content, but the cell itself is not removed. The cell content includes any formatting we've applied to the cell. That is, the cell will revert to the current default format.

Elements in a column are called a?

Vertical columns are called groups.

Horizontal rows are called periods.

On which variable terminal setting is done?

With 'stty' variable, Terminal settings is done in UNIX, where it displays all the terminal settings like the speed of the terminal, interrupted character, erase character, end-of-file character, etc.

Structure and function redula of pila?

The structure of a Pila is a long, coiled tube that is part of the excretory system in mollusks, specifically in snails. Its primary function is to remove nitrogenous wastes from the body by filtering them out of the blood and releasing them as urine. The Pila helps to maintain the internal environment of the snail by regulating the levels of waste products.

What are the 5 Cs of IED?

C- Confirm it is an IED

C- Clear the area (about 300 meters)

C- Cordon off the area

C- Call up the UXO report

C- Control traffic from entering the area (both vehicle and pedestrian)

Function of a MAR and MDR?

The Memory Address Register (MAR) holds the memory address that is currently being accessed or written to in the memory. The Memory Data Register (MDR) holds the data that is being read from or written to the memory at the address stored in the MAR. Together, the MAR and MDR facilitate the communication between the CPU and memory in a computer system.

What are the objectives of a system?

The objectives of a system are to efficiently achieve specific goals or tasks, improve productivity, streamline processes, enhance communication and collaboration, reduce errors and redundancy, and provide reliable and timely information for decision-making. Systems are designed to optimize resources, minimize costs, and enhance overall performance and effectiveness.

Why it is important to those who will be involved in implementation to understand and accept the solution to the problem?

Understanding: if you don't know what you are supposed to do, how are you honestly expected to do it?

Acceptance: if you don't agree with something, will you actually try your hardest to ensure it succeeds?

What is the atmospheric gas that exists in variable amounts?

Water vapor is the atmospheric gas that exists in variable amounts. Its concentration can vary depending on factors such as temperature and location.

Example code in pascal that will convert numbers into words?

function conv2(x:integer):string;forward;

function conv3(x:integer):string;forward;

{***********Fonction_1*************}

function conv1(x:integer):string;

var temp:string;

begin

if (x>19) and (x<100) then conv2(x)

else if (x>100) then conv3(x)

else begin

case x of

1:temp:='un ';

2:temp:='deux ';

3:temp:='trois ';

4:temp:='quatre ';

5:temp:='cinq ';

6:temp:='six ';

7:temp:='sept ';

8:temp:='huit ';

9:temp:='neuf ';

10:temp:='dix ';

11:temp:='onze ';

12:temp:='douze ';

13:temp:='treize ';

14:temp:='quatorze ';

15:temp:='quinze ';

16:temp:='seize ';

17:temp:='dix sept ';

18:temp:='dix huit ';

19:temp:='dix neuf ';

end;

conv1:=temp;

end;

end;

{*************Fonction_2******************}

function conv2(x:integer):string;

var temp:string;

z,y:integer;

begin

if (x<20) then conv1(x)

else if (x>100)then conv3(x)

else begin

z:=x div 10; {= pour garder la partie gauche de x [4]5}

y:=x mod 10; {= pour garder la partie droite de x 4[5]}

if y=0 then

begin

case z of

2:temp:='vingt ';

3:temp:='trente ';

4:temp:='quarante ';

5:temp:='cinquante ';

6:temp:='soixante ';

7:temp:='soixante diz ';

8:temp:='quatre vingt ';

9:temp:='quatre vingt dix ';

end;

end

else

if y=1 then

begin

case z of

2:temp:='vingt et un ';

3:temp:='trente et un ';

4:temp:='quarante et un ';

5:temp:='cinquante et un ';

6:temp:='soixante et un ';

7:temp:='soixante et onze ';

8:temp:='quatre vingt et un ';

9:temp:='quatre vingt et onze ';

end;

end

else

begin

case z of

2:temp:='vingt '+conv1(y);

3:temp:='trente '+conv1(y);

4:temp:='quarante '+conv1(y);

5:temp:='cinquante '+conv1(y);

6:temp:='soixante '+conv1(y);

7:temp:='soixante '+conv1(10+y);

8:temp:='quatre vingt '+conv1(y);

9:temp:='quatre vingt '+conv1(10+y);

end;

end;

conv2:=temp;

end;

end;

{****************fonction_3*******************}

function conv3(x:integer):string;

var temp:string;

z,y:integer;

begin

if (x>19) and (x<100) then conv3:=conv2(x)

else if (x<20)then conv3:=conv1(x)

else begin

z:=x div 100; {= pour garder la partie gauche de x [1]45}

y:=x mod 100; {= pour garder la partie droite de x 1[45]}

case z of

1:temp:='cent ';

2..9:temp:=conv1(z)+'cents ';

end;

case y of

1..19: temp:=temp+conv1(y);

20..99:temp:=temp+conv2(y);

end;

conv3:=temp;

end;

end;

{**********Fin des fonctions de la conversion***********}

Begin

{----# Initialisation #-------}

debut:

ClrScr;

i:=1;

bool:=true;

{-----# Selection de type du produit #------}

while bool=true do

begin

clrscr;

New(tab[i]);

writeln;writeln;

Writeln(' le type du produit ');

writeln(' 1.Aliment/Détergent');

writeln(' 2.Electromenager');

writeln(' 3.Meuble');

writeln(' 4.Autre');

write(' FAITES VOTRE CHOIX : ');

readln(c);

case c of

'1':tab[i]^.TVA:=(5/100);

'2':tab[i]^.TVA:=(15/100);

'3':tab[i]^.TVA:=(20/100);

'4':tab[i]^.TVA:=(10/100)

else

goto debut; {-------- si c () 1..4 retour au debut }

end;

{------# Lire les attributs de chaque produit #-------}

writeln;

writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³Numero de Produit ³ ³');

writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ');

writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³Designation ³ ³');

writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ');

writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³PrixUnitaire ³ ³');

writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ');

writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³Quantite ³ ³');

writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ');

writeln;

with tab[i]^ do

begin

gotoxy(38,13);

writeln(i);

num:=i;

gotoxy(38,16);

readln(design);

gotoxy(38,19);

readln(prixU);

gotoxy(38,22);

readln(Qt);

end;

writeln;

writeln(' ³Y a t-il d''autre produit?o/n ³ ³');

gotoxy(49,23);

c:=readkey;

if c='o' then

begin

bool:=true;

i:=i+1;

end

else

bool:=false;

end;

{-------# Calculer les prixHT et TTC de chaque produit #-------}

for j:=1 to i do

begin

with tab[j]^ do

begin

prixHT:=prixU*Qt;

prixTTC:=prixHT+prixHT*TVA;

end;

end;

{----# Calculer le total HT et TTC de la facture #----}

totalHT:=0;

totalTTC:=0;

for j:=1 to i do

begin

with tab[j]^ do

begin

totalHT:=totalHT+prixHT;

totalTTC:=totalTTC+prixTTC;

end;

end;

{-------------------# Affichage de la facture #---------------------}

writeln;writeln;

textcolor(2);

writeln(' ÚÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³Num³Designation³Prix Unitaire³QUANTITE³TVA %³ PrixHT ³ PrixTTC ³');

writeln(' ÃÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³');

writeln(' ÀÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ');

writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿');

writeln(' ³TOTAL HT ³ ³');

writeln(' ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´');

writeln(' ³TOTAL TTC ³ ³');

writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ');

textbackground(blue);

textcolor(14);

for j:=1 to i do

begin

with tab[j]^ do

begin

gotoxy(12,j+3);

writeln(num:2);

gotoxy(16,j+3);

writeln(design);

gotoxy(29,j+3);

writeln(PrixU:2:2);

gotoxy(45,j+3);

writeln(Qt:0:0);

gotoxy(53,j+3);

writeln(TVA*100:0:0);

gotoxy(58,j+3);

writeln(PrixHT:2:2);

gotoxy(70,j+3);

writeln(PrixTTC:2:2);

end;

end;

gotoxy(69,21);

writeln(totalHT:2:2,' DA');

gotoxy(69,23);

writeln(totalTTC:2:2,' DA');

{-------#conversion#--------}

milles:='';

cents:='';

a:=trunc(totalTTC);

b:=frac(totalTTC);

d:=trunc(b*100);

x:=a div 1000;

if x=0 then milles:=''

else if x=1 then milles:='mille '

else milles:=conv3(x)+'milles ';

y:=a mod 1000;

if y=0 then cents:=''

else cents:=conv3(y);

resultat:=milles+cents;

gotoxy(1,24);

writeln('Arrèt la facture à la somme :');

write(resultat,'DA ');

if d=0 then writeln('')

else

if d=1 then writeln('et un centime')

else

writeln('et ',conv3(d),'centimes');

readln;

end.