answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What does the suffix path mean?

The suffix "path" comes from the Greek word "pátheia". "Pátheia" means suffering or feeling. It's used to describe people who have illnesses and those that treat illness.

What is the difference between oriented and orientated?

The difference is that Americans generally say "oriented," while the British say "orientated." It means the same in either case.

How fast is bluetooth?

It's about 720 Kb/s -that's bits, not bytes. By contrast a serial port will top out at 115 Kb/s and USB is 12 Mb/s.

Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store An Invoice should include four pieces of information as instance variables a part n?

Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables-a part number (type String), a part description (type String), a quantity of the item being purchased (type int) and a price per item (double). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. Write a test application named InvoiceTest that demonstrates class Invoice's capabilities. I need the code in Visual Basic.NET

What is binary tree travesal?

It's the process of stepping through each node of a binary tree so that you reach each one at least once.

Binary tree traversal is special in that the output of the tree is sorted.

If you're looking for how it is done, I would highly recommend reading up on binary trees. It is easy to describe in pictures or code. I recommend against trying to get a description in text, it would only be confusing.

How old is Len Kagamine?

Len Kagamine (brother) and Rin Kagamine (sister) are vocal personas created by the Vocaloid 2 speech program and released on December 27, 2007. Kagamine means "mirror sound." The pitch of the voices corresponds roughly to 14-year-old individuals.

Is it possible to use the bubble sort algorithm to sort strings?

Bubble sort will be able to sort the items lexicographically, if you first assign the strings a relative value. The way strcmp in the C library does this is by returning the difference of the first different characters between the strings. For instance, if you call strcmp("Hello", "Highway"), strcmp will return 'e'-'i'. The ascii value of e on a unix system is 101 and the ascii value of i is 105, so it is returning the value 101-105 = -4 which will tell you that "Hello" is lexicographically smaller than "Highway". Doing this, you should be able to use any algorithm you want to sort the strings.

What are acceptable file names?

It depends on the file systems supported by the operating system. Most file systems use the concept of files and directories (or folders) to access data stored on a device. File names and directory names usually follow the same naming conventions on a given system. Every file and directory has a set of attribute bits (flags) associated with it and one of those attributes is the directory bit. If the bit is set, the name refers to a directory otherwise the name refers to a file.

On the older MS-DOS FAT file system, file and directory names are limited to 8 characters for the base name and 3 for the extension, commonly referred to as an 8.3 file name. The dot separator is considered part of the file name, thus file names are limited to a maximum of 12 characters. The newer Windows FAT and NTFS file systems support longer file names, but in order to retain backward compatibility with the older FAT system, file names that do not conform to the 8.3 file naming convention are automatically given a second short file name that does conform. Such files can therefore be referred to by either name. For example, the "C:\Program Files" folder can be referred to as "C:\PROGRA~1". Note that any file name with a space character is considered a long file name because the 8.3 naming convention does not support space characters.

You may use any characters in the current code page for a name, including Unicode characters and characters in the extended character set (128-255), except for the following characters:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

In addition, the following restrictions apply:

  • Integer value zero, sometimes referred to as the ASCII NUL character.
  • Characters whose integer representations are in the range from 1 through 31, except for alternate data streams where these characters are allowed.
  • Any other character that the target file system does not allow.

The following names are also reserved and cannot be used to name a file or directory:

  • CON
  • PRN
  • AUX
  • NUL
  • COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8 and COM9
  • LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9

Note that although the newer FAT and NTFS file systems allow mixed-case file names, they are not case-sensitive by default. That is, "TEMP", "Temp" and "temp" all refer to the same file or directory. However, when searching for files, you can use case-sensitivity to filter out unwanted files. For example, searching for "T*" with case-sensitivity turned on will find only those files that begin with a capital 'T'.

Under the newer FAT and NTFS system, the Windows API imposes a maximum length of a fully-qualified path to 260 characters including the terminating null character. Given a fully-qualified path name is of the form volume:\component(s), the maximum length for any one component (file or directory name) is 256 characters. However, the Windows API also supports Unicode versions which permit extended-length paths of up to 32,767 characters with a maximum component length of 255 characters. To specify an extended-length path, use the "\\?" prefix. For example, "\\?\D:\very long path".

Note that the shell and the file system have different requirements thus it is possible to create a path using the Windows API that the shell user interface is not able to interpret correctly.

What does data integrity mean?

"Data integrity refers to the maintenance of, and the assurance of the accuracy and consistency of, data over its entire life-cycle, and is a critical aspect to the design, implementation and usage of any system which stores, processes, or retrieves data". Source: Wikipedia.

How is geometry used in computer designing?

In computer design the geometrical objects are requried to visualise the algoritmic steps of problem domain.

Is this true that an open source software will delete Microsoft products?

Yes. That is 100% true. Microsoft and Linux will engage in an outright war on your computer. Basically, trying to simplify the term softwar, they both have distructive viruses in their code. Unfortunately for Microsoft, Linux has the better defence system and a better virus.

What does the error 'Null Pointer Assignment' mean?

The null pointer assignment error means your program has attempted to access a memory address that does not belong to your program. This typically occurs when accessing memory indirectly through a pointer:

int* p = nullptr; *p = 42; // Error: null pointer assignment

The above is the classic example of this type of error. The null address is typically the all-zeroes address (0x0) but, regardless of the physical address, it must never be accessed because it is a system address. We typically refer pointers to the null address when they are no longer in use or we don't have an address we can (yet) assign to them.

Passing unchecked pointers to functions is another common cause:

void f (int* p) {

*p = 42; // potential error

// ...

}

In the above example there's no guarantee p refers to a non-system address. Although we can easily test p is non-null before accessing it, that won't guarantee p refers to a non-system address. However, we can greatly reduce the risk of error by passing memory address via references instead of pointers:

void f (int& r) {

r = 42;

// ...

}

There's still potential that r refers to a system address if the address were passed via a pointer, however there is seldom any need to use unchecked pointer variables in C++. References and resource handles (or smart pointers) eliminate the need for pointers and are actually more efficient than pointers because testing for null becomes largely redundant.

The only time we really need a pointer is when "no object" is a valid argument:

void f (int* p) {

if (p == nullptr) {

// the "no object" code

} else {

// code that operates on an object

}

}

What is LPT1?

LPT1 is a port found on older computers and some newer ones that you can connect a printer to. This port is a female connector with 25 pinholes.

Will either kruskal or prim's algorithm work on negative edge graph?

The correctness of either Prim's or Kruskal's algorithm, is not affected by negative edges in the graph. They both work fine with negative edges.

The question boils down to "Does a Priority Queue of numbers work with negative numbers?" because of the fact that both Prim's and Kruskal's algorithm use a priority queue. Of course -- as negative numbers are simply numbers smaller than 0. The "<" sign will still work with negative numbers.

I am making a C plus plus program for a programming class that takes in 5 grades for 7 students averages them gets a letter grade and displays it all in a table How do you set up a table for variables?

The following example sets up a two-dimensional array, initialises it with some pseudo-random data, and then prints the table and the averages.

#include<iostream>

#include<time.h>

int main()

{

const int max_students = 7;

const int max_student_grades = 5;

const int max_grades = 6;

const char grade[max_grades]={'A','B','C','D','E','F'};

srand((unsigned) time(NULL));

// Initialise the array with pseudo-random grades:

int table[max_students][max_student_grades];

for(int student=0; student<max_students; ++student)

{

for(int student_grade=0; student_grade<max_student_grades; ++student_grade)

{

table[student][student_grade] = rand()%max_grades;

}

}

// Print the table and average the results.

int overall=0;

for(int student=0; student<max_students; ++student)

{

int average=0;

std::cout<<"Student #"<<student+1;

for(int student_grade=0; student_grade<max_student_grades; ++student_grade)

{

std::cout<<" Grade #"<<student_grade+1<<": "<<grade[table[student][student_grade]]<<", ";

average+=table[student][student_grade];

}

std::cout<<" Average: "<<grade[average/max_grades]<<std::endl;

overall+=average;

}

std::cout<<"Overall average: "<<grade[overall/max_grades/max_students]<<std::endl;

return(0);

}

Example output:

Student #1 Grade #1: A, Grade #2: E, Grade #3: D, Grade #4: E, Grade #5: F, Average: C

Student #2 Grade #1: E, Grade #2: D, Grade #3: E, Grade #4: E, Grade #5: E, Average: D

Student #3 Grade #1: D, Grade #2: A, Grade #3: D, Grade #4: B, Grade #5: A, Average: B

Student #4 Grade #1: C, Grade #2: B, Grade #3: A, Grade #4: A, Grade #5: B, Average: A

Student #5 Grade #1: E, Grade #2: D, Grade #3: C, Grade #4: F, Grade #5: E, Average: D

Student #6 Grade #1: C, Grade #2: D, Grade #3: A, Grade #4: F, Grade #5: A, Average: B

Student #7 Grade #1: B, Grade #2: D, Grade #3: F, Grade #4: B, Grade #5: C, Average: C

Overall average: C

What are the applications and tools used by computer hardware servicing?

That greatly depends on your focus.

  • End-user desktop repair typically focuses on replacement of whole parts such as a motherboard or hard drive. This type of repair typically only requires screwdrivers and context-based diagnosis, and the more advanced, flashy software or hardware diagnosis tools are either inaccurate or focus only on particular circumstances that your issue may or may not fall under. Other than a good SMART tool for hard drives and a RAM test program, software that attempts to diagnose problems typically can cause hardware failure on a damaged or poorly-designed computer, and should be used with caution.
  • End-user mobile repair, laptop repair, and gaming console repair requires good jeweler's screwdrivers and security bits or pry tools, but otherwise nothing more than the desktops do. Diag tools, if available for the device you're working on, are again of little use unless the issue is clearly within their scope, and are almost certainly dangerous if they attempt to stress test any part of the system, as very few portable devices can tolerate full load for an extended period of time.
  • Lastly, middle-vendor repair and manufacturing repair make use of soldering irons and multimeters to repair the circuit boards themselves. These forms of repair require a certain degree of knowledge of electronics, and technical documentation from the manufacturer is highly recommended. Many technicians at this level will often specialize in only one model or one type of product, and may also be required to reflash storage units attached to the boards if applicable. Reprogramming is typically done using a "sled" that makes contact in the correct places without requiring soldering. If you have access to the tools and documentation essentially required to repair at this level, you probably already know about it.

What kind of symbok is an asterisk for a character in a search?

It is commonly used as a zero-or-more wildcard character match. "o*k" matches "ok" and "oak", but not "ox".

What are low level image features?

They are features that are darker than other features such as if you were in a cave and the far side is darker than the other side than that is the low level image feature. ( they can be in any rainforest and in any caves or oceans.)

Multi-site case study?

Its a study done or involving more than one site, for example, five schools.