answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Simulation of finite state automata to recognize the tokens of control statement?

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char a[8];int s,i,flag=0,loc1=0,loc2=0,j;

clrscr();

printf("Enter any string\n");

gets(a);

for(i=0;i<8;i++)

{

int ch=a[i];

if(ch!=32)

{ loc2=i;

flag++;

}

if(ch==32)

{ s=flag; flag=0;

switch(s)

{

case 2:

if(a[loc1]=='i' && a[loc2]=='f')

printf("STRING HAS if AS A KEYWORD");

break;

case 3:

if(a[loc1]=='f' && a[loc1+1]=='o' && a[loc2]=='r')

printf("STRING HAS for AS A KEYWORD");

break;

default:

printf("not our case");

}

}

}

getch();

}

What do understand by inward-oriented policies?

Question:What do you understand by 'inward-oriented policies'? please give the answer

What are the five examples computer language?

Machine code, assembly language, COBOL, FORTRAN and C. Machine code is the only language that is native to the machine. All others must be converted to machine code.

Definition of latent error as used in computer programming?

A latent error is a hidden error that only shows up when a particular set of data is entered.

Can you develop a game by using JavaScript?

Yes. Several types of games have been created using JavaScript. Mostly, they involve very basic RPGs or guess-the-number games. The trouble with JS games is that, generally, the answer is right in the code, so that a user who understands and can parse JavaScript, and/or has certain tools such as a JS console, can cheat at the game. There are methods of obfuscating the solutions, but unless some sort of one-way hash is used to store and check the solution instead of plaintext, it can lose its fun.

What is difference between oop and advanced oop?

the word advanced. If these 2 are course titles, the institute should have the course descriptions. In software development, it would be the first time for me to hear about advanced oop. (what is the basic oop, then?)

How many sides does a quadrilacteral?

it has 4 sides but the basic shapes tend to be a square, rectangle and kite

Was the person who made computer terms hungry?

No. A "bit" is an abbreviation of binary digit. The term "byte" was coined in 1956 by Werner Buchholz to refer to a bit grouping (typically 8 bits). The deliberate mis-spelling was simply to avoid any accidental mutation of bite to bit.

Why parenthesis are never needed in prefix or postfix notation?

Because there is not an "order of operations" in prefix or postfix notation. The order in which you put the numbers and operators is the order in which calculation occurs.

Can you give a C programm about Shortest seek time first algorithm?

Suppose that a disk drive has 5000 cylinders, numbered 0 to

4999. The drive is currently serving a request at cylinder 143,

and the previous request was at cylinder 125. The queue of

pending requests, in FIFO order, is

86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

Starting from the current head position, what is the total

distance (in cylinders) that the disk arm moves to satisfy all the

pending requests, for each of the following disk- scheduling

algorithms?

A. FCFS

B. SSTF

C. SCAN

D. LOOK

E. C-SCAN

F. C-LOOK

Answer:

A. The FCFS schedule is 143, 86, 1470, 913, 1774, 948, 1509,

1022, 1750, 130. The total seek distance is 7081.

B. The SSTF schedule is 143, 130, 86, 913, 948, 1022, 1470,

1509, 1750, 1774. The total seek distance is 1745.

C. The SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750,

1774, 4999, 130, 86. The total seek distance is 9769.

D. The LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750,

1774, 130, 86. The total seek distance is 3319.

E. The C-SCAN schedule is 143, 913, 948, 1022, 1470, 1509,

1750, 1774, 4999, 0, 86, 130. The total seek distance is

9985.

F. The C-LOOK schedule is 143, 913, 948, 1022, 1470, 1509,

1750, 1774, 86, 130. The total seek distance is 3363.

What is the minimum sat score required to get into uc Berkeley with a GPA of 3.5?

With a GPA of 3.5, it is very difficult to get into Berkeley regardless of your SAT score. The main issue is that if you score a 1700-2100, you have no chance. Yet if you magically score a 2400 or at least a 2300, it will seem like you are lazy in school and colleges do not want students like this either. If you have excellent extra curriculars and recommendation letters, you may be able to get by. This means ranked in state for some sport, ASB president, etc. It helps if your school sends many students to Cal as well (examples include Monta Vista High School, Lynbrook High School, Mission San Jose High School, the Harker School, etc.) as the admissions office will be familiar with the rigor of your school's curriculum.

Keep in mind that each candidate is reviewed on a case-by-case basis. There is no "rubric" as such. This advice is just to keep you on par with other candidates.

Answer1000

Can a basic data type be converted into user defined data type in c?

Yes, but it cannot be done in C as intuitively as it can be done in C++:

struct X {

X (const int i): m {i} {} // converts an int to an X [C++ only]

X& operator= (const int i) { m=i; return *this; } // assign an int to an X [C++ only]

int m;

};

Usage:

X x {42}; // construct X from int

x = 0; // assign an int to an X

In C we must use a conversion function:

struct X convert (const int i) { // convert an int to an X

struct X;

x.m = i;

return x;

}

Usage:

struct X x;

x = convert (42);

Windows could not start because the following file is missing or corrupt?

reinstall windows, it depends on which operating system you have or computer manufacturer you have. on hp , tap the f11 key until it says " loading files" then go to system restore and restore your computer to the original factory condition. that's all. or if you bought this operating system, return if get another one. or else, its illegal and cracked. another thing if you have a warranty get it in for check up its going to be free, possibly ;] hope this helps;]

What is the best open source wiki software?

The "best" will depend on your specific needs / desired features and available software on your web host. MediaWiki (the engine for Wikipedia) is the most popular. Other options include MoinMoin (uses a flat file and Python), JAMWiki (written in Java), ThoughtFarmer (ASP.NET), or UseModWiki (Perl, flat file).

Write a program to find the prime factoe af a given number?

public class FindPrime {

public static void main(String[]args)
{
int nPrime =50; // Suppose the Number is 50
OuterLoop:
for(int i = 2; ; i++)
{
for(int j = 2; j < i; j++)
{
if(i % j==0)

continue OuterLoop;

}
System.out.println(i);
if(--nPrime ==0)
break OuterLoop;
}
}
}

What was the earliest computer languages and were they Binary Code FORTRAN COBOL.?

The oldest computer language is machine code and all computer languages are binary encoded. It's unavoidable on binary machines.

What is the difference between programming and algorithm?

A program is a detailed set of instructions for a computer to carry out, whle an algorithm is a detailed sequence of steps for carrying out a process.