Question about Operating Systems

1 Answer

Programs with variable number of arguments

Write a function that receives variable number of arguments, where the arguments are the coordinates of a point .based on the nomber of arguments received,the function should display type of shape like a point,line,triangle,etc.that can be drawn.

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Operating Sy... Master
  • 19,396 Answers

To start points and lines are not shapes, and a triangle is not representable with a single function, therefore you need a function to draw shapes , given a number of points as parameters, and one to draw math functions (lines etc.).

Here is an example: Draw Line, Ellipse, Polygon ...

From website above, here is script in JS:

"<script type="text/javascript">
<!--
function myDrawFunction()
{
jg_doc.setColor("#00ff00"); // green
jg_doc.fillEllipse(100, 200, 100, 180); // co-ordinates related to the document
jg_doc.setColor("maroon");
jg_doc.drawPolyline(new Array(50, 10, 120), new Array(10, 50, 70));
jg_doc.paint(); // draws, in this case, directly into the document

jg.setColor("#ff0000"); // red
jg.drawLine(10, 113, 220, 55); // co-ordinates related to "myCanvas"
jg.setColor("#0000ff"); // blue
jg.fillRect(110, 120, 30, 60);
jg.paint();

jg2.setColor("#0000ff"); // blue
jg2.drawEllipse(10, 50, 30, 100);
jg2.drawRect(400, 10, 100, 50);
jg2.paint();
}

var jg_doc = new jsGraphics(); // draw directly into document
var jg = new jsGraphics("myCanvas");
var jg2 = new jsGraphics("anotherCanvas");

myDrawFunction();

//-->
</script>"

Posted on Oct 27, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Trying to set the IPT Path for Anona Labs and getting an error


I think this Anona Labs is gone. There isn't even a web site for them. Have you tried just setting to the default path?

Jan 04, 2014 | Operating Systems

1 Answer

What are the arguments uses by c language and types of arguments


The arguments that are passed to a c program are argc and argv, they are passed to main as:
int main ( int argc, char **argv )
argc is a number which holds how many arguments were passed.
argv is an array of arrays which holds the text values of each of the arguments passed to the program.

For example to get the first argument passed to the program you can access it as argv[1] and treat it just as you would treat any char *. Note that argv[0] always contains the name of the program and is not counted in argc.


Hope this helps, and thank you for using FixYa.

Chartreuse,

Jan 28, 2011 | Operating Systems

1 Answer

Parallelogram WXYZ with vertices W(-2,2) X(2,3) Y(2,0) and Z(-2,-1)is translated by(-3,-2) what are the coordinates of X ?


Whenever talking about coordinates, the first number is the x-axis (left to right --> move right for a positive number, left for a negative number).  The second number is the y-axis (up & down: --> up for positive numbers, down for negative numbers).  All coordinates start from zero, so for your parallelogram:
W is 2 left then 2 up
X is 2 right then 3 up
Y is 2 right then stop
Z is 2 left then 1 down

Translating your parallelogram, just means (in this case) to move the whole thing 3 to the left and 2 down.

X starts at (2,3), so moving it 3 to the left will leave it at (-1, 3).  Then we move it 2 down, so it's final position is at (-1, 1)

Answer: The new coordinates of X are (-1,1)

Mar 22, 2010 | Microsoft Windows XP Professional

1 Answer

Where i can get software for C Programing language and what is the software name...........?


STEP 1 : Download the Borland Compiler
https://downloads.embarcadero.com/item/24778
STEP2 : Run the setup program
By default, it should install everything to C:\Borland\BCC55

STEP 3 : Add the /bin directory to the system PATH

>C:\Borland\BCC55\bin\bcc32 OR >c32

After the setup program is run (step 2), a whole bunch of executable programs are placed in a new directory : C:\Borland\BCC55\Bin. This step makes it possible for the Operating System (Windows) to find these new executables by name. If you don't do this, then you will need to specify the full path to bcc32 every time you use it.

To do this on Windows XP
Bring up the Environmental Variables :

•Right Click "My Computer" ( Depending on how your system is set-up, "My Computer" is either on your Desktop or in your Start Menu )
•Select "Properties"
•Activate the "Advanced" Tab
•Click the "Environmental Variables" Button
Append ";C:\Borland\BCC44\bin" to the PATH variable (figure 3-2)

•Select the PATH variable under User Variables
Note: The PATH variable may appear under both System Variables and User Variables. This How-To changes the User Variable.
•Click the EDIT button below the list
•In the "Edit User Variable" box that pops up, move the cursor to the end of the Variable Value field
•Add a semi-colon ";" to the end of the current value
Note: If the value is empty, then you do not need to add a semi-colon
•Add the path "C:\Borland\BCC55\bin" after the semi-colon
•"OK" your way out of the dialogs

STEP 4 : Set up some configuration files
you should create a configuration file for the bcc32 program that tells it where to find its libraries and include files.
•The file should be named bcc32.cfg
•It should be placed in the same bin directory where bcc32.exe is located
(C:\Borland\BCC55\Bin)
•The contents of the file are the command line options for bcc32 stating the location of include files and libraries:
-I"C:\Borland\BCC55\Include"
-L"C:\Borland\BCC55\Lib"
Regards,

Soul_srch007

Dec 06, 2009 | Microsoft Windows XP Professional

5 Answers

Fatal Error: Loading module SGEDRV.dll failed (Error #126).


Right Click om "My Computer" and select Properties | Advance Tab | Environment Variables.

Select Path Variable in the lower part of the box by clicking on it and add C:\Program Files\Utimaco\Safeguard Easy

Note: To insert ; (semi colon symbol) after the previous path

Thank you
Dion S

May 06, 2009 | Microsoft Windows XP Professional With...

1 Answer

Access 2000 forms and combo boxes


I could be getting confused with programming Languages, but here is a shot in the dark. You may have to code or give argument to each combo box that <when selected if (other box) is blank then update (other box)> or somthing similiar, MAYBE?????

Apr 03, 2009 | Microsoft Access 2000

2 Answers

HOW TO PROGRAM ARITHMETIC ALGORITHM( ADDITION)IN C++


above int main () you will want "using namespace std;" without quotes. Under that, "int main ()" without quotes, then a [ bracket to start the main function.
Please rate, thanks!

Mar 16, 2009 | Operating Systems

1 Answer

Programming in c


To convert numbers you can use the printf() function
printf("%d", x'FF') hex to decimal
printf("%o", x'FF') hex to octal

If you want to save the value in another variables use sprintf
e.g

a = x'FF';
b = sprintf("%d",a)


Jan 15, 2009 | Operating Systems

1 Answer

Write a complete program thats read the loops.


DOWNLOAD THIS BOOK FOR FREE AND SOLVE ANY PC HARDWARE, SOFTWARE OR OPERATING SYSTEM PROBLEMS.


42b4719.jpg

DOWNLOAD NOW......

Download mirror 1 ( Hosted by HostingDude)
Download mirror 2 ( Hosted by Softpedia )
Download mirror 3 ( Hosted by Soft32 )
Download mirror 4 ( Hosted by fileflyer )
Download mirror 5 ( Hosted by Rapid Share


366

Oct 10, 2008 | Operating Systems

1 Answer

Java program


I would use Perl, easier. Maybe even use POP and PUSH on ARGV to pull the forst argument off as directory and last as extension treating all the other entries as search criteria.

#!/usr/bin/perl # # Date: 13/02/2008 # # Author: Adrian Pavone # # This script takes a specified directory with any number of keywords as arguments,
# and then searches all sub directories, for those keywords. It only # returns a match if it finds all keywords in the same file name. # use File::Find; $dir =$ARGV[0];
; @searchTerms = @ARGV; find ( sub { for my $term (@searchTerms) { return unless $_ =~ /\Q$term/i; } print "$File::Find::name\n"; }, $dir);

Sep 18, 2008 | Operating Systems

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

118 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18299 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...