answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Can we seal a 3 foot crack in a vent stack instead of replacing the entire stack and if so what materials would you use?

if it is above any water carrying capacity (area that has drain water flowing through it) and is truly just a vent stack it should be sealable using a clear silicone caulking.

Write c program to find median?

If you are using an array : sort using qsort() then take middle element.

How a check digit is calculated?

Check digits are determined (or derived) by a set algorithm using the digits of the account number.

Is there an absolute 'right' and 'wrong' way of writing pseudo code?

No. There is no "right way" and "wrong way" of writing pseudo code, let alone qualifying with "absolute".

However, a pseudo code is "wrong" if it cannot be understood, or it is incorrect in semantic (what the code tries to describe, solve, etc)

What is windows live incoming email server?

In the Incoming mail (POP3, IMAP, or HTTP) server box, type pop3.live.com. In the Outgoing mail (SMTP) server box, type smtp.live.co

What is Java byte-code level language?

Java byte-code is the code which generate after the compilation of .java file.And this code is only understand by JVM(java virtual machine ) which understand it and execute it.In other languages this type of functionality is not available.

What is the meaning of 'AB testing'?

A/B testing, split testing, or bucket testing is a method of marketing testing by which a baseline control sample is compared to a variety of single-variable test samples in order to improve response rates. A classic direct mail tactic, this method has been recently adopted within the interactive space to test tactics such as banner ads, emails and landing pages.

Most round-robin schedulers use a fixed size quantum Give an argument in favor of a small quantum .Now give an argument in favor of a large quantum. Compare and contrast the types of systems and jobs?

An argument against a small time quantum: Efficiency. A small time quantum requires the timer to generate interrupts with short

intervals. Each interrupt causes a context switch, so overhead increases with a larger number of interrupts.

An argument for a small time quantum: Response time. A large time quantum will reduce the overhead of context switching since

interrupts will be generated with relatively long intervals, hence there will be fewer interrupts. However, a short job will have to wait

longer time on the ready queue before it can get to execute on the processor. With a short time quantum, such a short job will finish

quicker and produces the result to the end user faster than with a longer time quantum

In Visual Basic how do you place a tab into a string with the and sign?

In visual Basic, the tab character has several representations:

  • ChrW(9)
  • vbTab
  • ControlChars.Tab
  • Convert.ToChar(Keys.Tab)

Of these, the last is supported by all .NET languages (including C# where '\t' can also be used).

To insert a tab into a Visual Basic string:

Dim text As String = "abc"

text.Insert (1, vbTab)

To insert an ampersand, use the character literal '&':

text.Insert (2, '&');

Why 4gl is called non procedural language?

because it is non-procedural language, in this language object oriented languages are use to develop software application.

Definition of computerised accounting?

computerized accounting is method of accounting using modern accounting technology .it will reduce the problems in manual accounting and help to save time

cost ,prepare accurate accounts and also help to easy communication of accounts.

What does a two dimentional pyramid look like?

By looking at it in two dimensions, you would only be able to see one side at a time on the x,y plane. Therefore, it would simply be a triangle.

What are the main two problems in multiprogramming environment when processes are run concurrently and share the resources?

Problems Stealing or copying a user's files; Writing over another program's (belonging to another user or to the OS) area in memory; Using system resources (CPU, disk space) without proper accounting; Causing the printer to mix output by sending data while some other user's file is printing.

Pseudocode could be logically incorrect if not properly indented?

The indentation doesn't affect the "logic" of the program, however it would make it make harder to read and the purpose of pseudocode is to be read.

What is a macro view of history?

The big picture is what best describes a Macro View.

Why C language is called mid level language justify with an example?

C language support bit-level manipulation that are normally done in assembly or machine level language. C reduce the gap between high level and low level

language. So, it's called as middle level language.

How do you write a BIOS?

basic input and outpt system

replay: I did not ask what it stands for I asked how do I write one!

Write a c programme with lucas series?

//Lucas series - 2,1,3,4,7,11,18

#include <stdio.h>

#define PRINTMAX 50

void lucas(int first, int second) //Prints 52 numbers

{

int count=1,total;

printf("%d\t%d\t",first,second);

while (count < PRINTMAX)

{

total = second + first;

printf("%d\t",total);

first = second;

second = total;

count++;

}

}

int main(void)

{

lucas(2,1);

return 0;

}

Conversion of expression in binary tree in data structure?

1 Mayuresh Pardeshi (pardeshimayuresh@gmail.com) /*Binary Tree Expression Solver 2 * By James Brannan, 2005. 3 * irregularexpression@gmail.com 4 * You may copy and redistribute 5 * this code free of charge as you 6 * see fit. 7 */ 8 9 using System; 10 using System.Collections.Generic; 11 using System.Text; 12 13 14 namespace Tree 15 { 16 // Node Class: Base for binary tree, holds data for left and right nodes. 17 class Node 18 { 19 // Stack used to solve for a given tree. 20private Stack stack = new Stack(); 21 22 // Solves a tree 23 public int Solve() 24 { 25 /* This method uses a stack to solve the expression. The postfix 26 * notation is tokenized and systematically added to the stack. 27 * When the stack encounters an operation, it is executed and 28 * modifies the contents on stack. The final item left on the 29 * stack (given the expression was valid) is the answer. 30 */ 31 string a , b; // Temporary placeholders for popped values 32 string[] tokens = Postfix().Split(' '); // Tokenize the postfix output 33 foreach (string e in tokens) 34 { 35 switch (e) 36 { 37 /* For operation cases, the last two items added to the stack are 38 * removed and acted upon. For any other case, the value is pushed 39 * onto the stack. 40 */ 41 case "+": 42 b = stack.Pop(); 43 a = stack.Pop(); 44 stack.Push(Convert.ToString(Convert.ToInt16(a) + Convert.ToInt16(b))); 45 break; 46 case "-": 47 b = stack.Pop(); 48 a = stack.Pop(); 49 stack.Push(Convert.ToString(Convert.ToInt16(a) - Convert.ToInt16(b))); 50 break; 51 case "/": 52 b = stack.Pop(); 53 a = stack.Pop(); 54 stack.Push(Convert.ToString(Convert.ToInt16(a) / Convert.ToInt16(b))); 55 break; 56 case "*": 57 b = stack.Pop(); 58 a = stack.Pop(); 59 stack.Push(Convert.ToString(Convert.ToInt16(a) * Convert.ToInt16(b))); 60 break; 61 case "%": 62 b = stack.Pop(); 63 a = stack.Pop(); 64 stack.Push(Convert.ToString(Convert.ToInt16(a) % Convert.ToInt16(b))); 65 break; 66 default: 67 stack.Push(e); 68 break; 69 } 70 } 71 // Value left over is the result of the expression 72 return Convert.ToInt16(stack.Pop()); 73 } 74 75 // Returns the prefix notation for the expression 76 public string Prefix() 77 { 78 /* Function recurses through the left then right 79 * nodes after its value. 80 */ 81 string res = this.Value + " "; 82 if (this.left != null) // If node is not a leaf, then recurse 83 { 84 res += this.left.Prefix(); 85 res += this.right.Prefix(); 86 } 87 return res; 88 } 89 90 // Returns the postfix notation for the expression 91 public string Postfix() 92 { 93 /*Function recurses through the left then right, 94 * bottom-up. All leafs are returned before their 95 * parent operators. 96 */ 97 string res = ""; 98 if (this.left != null) //If node is not a leaf, then recurse 99 { 100 res += this.left.Postfix() + " "; 101 res += this.right.Postfix() + " "; 102 } 103 res += this.Value; 104 return res; 105 } 106 107 // Returns the (fully parenthesized) infix notation for the expression 108 public string Infix() 109 { 110 /*Function recurses through left, then returns 111 * value, and recurses right. Each expression is 112 * nested in parentheses. 113 */ 114 string res = ""; 115 if (this.left != null) 116 { 117 res = res + "(" + left.Infix() + " " + Value + " " + right.Infix() + ")"; 118 } 119 else 120 { 121 res += Value; 122 } 123 return res; 124 } 125 126 // Constructor for subnodes 127 public Node(char op, Node l, Node r) 128 { 129 left = l; 130 right = r; 131 Value = op.ToString(); 132 } 133 // Constructor for leaf nodes 134 public Node(string value) 135 { 136 //Leaf nodes have no left or right subnodes 137 left = null; 138 right = null; 139 Value = value; 140 } 141 142 //Node connected on the left 143 private Node left; 144 // Node connected on the right 145 private Node right; 146 // Value (operator or term) 147 private string Value; 148 } 149 150 // Sample program: 151class Program 152 { 153 /* The code below demonstrates the use of the Node class. The expression being 154 * tested is graphed as shown below. (Make sure you're using a monospace font) 155 * (((1-2)-3) + (4*(5+6))) 156 * + 157 * / \ 158 * - * 159 * / \ / \ 160 * - 3 4 + 161 * / \ / \ 162 * 1 2 5 6 163 */ 164 165 static void Main(string[] args) 166 { 167 Node root = new Node('+', new Node('-', new Node('-', new Node("1"), new Node("2")), new Node("3")), 168 new Node('*', new Node("4"), new Node('+', new Node("5"), new Node("6")))); 169 Console.WriteLine("Prefix notation: \t" + root.Prefix()); 170 Console.WriteLine("Postfix notation: \t" + root.Postfix()); 171 Console.WriteLine("Infix notation: \t" + root.Infix()); 172 Console.WriteLine("Solution for tree is:\t" + root.Solve()); 173 Console.ReadKey(true); 174 } 175 } 176 }

Difference between class and structure in csharp?

I'm not sure about csharp, but in OO a class has a state and behaviour whereas structure has only state.

The state of a class is the data members, or attributes of a class. Behaviour of a class is the function members, or the methods of a class. Ie, a class has attributes and functions, but a struct has only attributes.

Historically, classes derived from structures. At one point someone thought of adding behaviour or functionality to structures and the resulting type was called a class.

I'll give you an example.

struct Student {
//state
int YearInCollege;
};

This structure has only data members that can be manipulated in the program. Eg:

Student You;
You.YearInCollege=1; //change state
...
int a=You.YearInCollege; //read state

As you can see, we can read and write the members of a structure as we wish.

Now, let's give the structure a bit of functionality.

class Student {
//behaviour
int WhatsMyYearInCollege(void);
void ChangeMyYearInCollege(int);

//state
int YearInCollege;
};

as you can see, now besides the state we also have functionality to change the state of the class. Now, we'll change the state of the class only through its own member functions, also called mutator functions. Eg:

Student You;

You.ChangeMyYearInCollege(2); //change state through class' own function
...
int a=You.WhatsMyYearInCollege(); //read state through class' own function

What is a source code for memrise?

The Memrise website content, including program source code, is owned by Memrise Inc. Being proprietary intellectual property, the source code is not available within the public domain and therefore cannot be published here.

A program prints vertically a numbers in c program?

It is too easy................

//Program to print numbers vertically

#include<stdio.h>

#include<conio.h>

void main()

{

int last_no;

int i;

clrscr();

i=0;

printf("Enter your last num.I will print 0 to that number");

scanf("%d",&last_no);

printf("\n");

while(i>last_no)

{

printf("%d\n",i);

i++;

}

getch();

}

//poo.papule