Question

In: Computer Science

Write one difference for items below a.     char versus Character b.     Source code versus Byte code c.    Complier error...

Write one difference for items below

a.     char versus Character

b.     Source code versus Byte code

c.    Complier error versus Runtime error

d.   char [ ] versus String [ ]

Solutions

Expert Solution

a. char is a primitive type that represents a single 16 bit Unicode character while Character is a wrapper class that allows us to use char primitive concept in OOP-kind of way.

b.Source code refers to the high-level code or assembly code that is generated by a human/programmer. So the statements written in any programming language is termed as source code. ... Byte code is an intermediate code between the source code and machine code.

c.Compile-time errors are generally referred to the error corresponding to syntax or semantics. Runtime errors on the other hand refer to the error encountered during the execution of code at runtime

d.Char is a single alphabet where as String is a sequence of characters. Char is primitive datatype where as String is a class. A char holds a single character, while a string holds lots of characters.

Any queries just comment

Give thumbsup

Thank you and all the best


Related Solutions

Write in C programming language Write the function replace(char b[], char f[], char t[]). which finds...
Write in C programming language Write the function replace(char b[], char f[], char t[]). which finds the string 'f' in the string 'b' and replaces it with the string 't'. You can assume that f and t same length Example: char string[] = "zap";     replace(string, "ap", "oo"); --changes 'string' to "zoo".     *don't assume substring being replaced is singular, or that its own substrings are unique.     *Don't re scan letters already checked and replaced         char string[] =...
How do I write a C# and a C++ code for creating a character array containing...
How do I write a C# and a C++ code for creating a character array containing the characters 'p', 'i', 'n','e','P','I','N','E' only and then using these lower and capital case letter character generate all possible combinations like PInE or PinE or PIne or PINE or piNE etc. and only in this order so if this order is created eg. NeIP or EnPi or NeIP or IPnE and on. You can generate all the combinations randomly by creating the word pine...
Please write code in c++ using iostream library. Write a function bool cmpr(char * s1, int...
Please write code in c++ using iostream library. Write a function bool cmpr(char * s1, int SIZE1, char * s2, int SIZE2) that compares two strings. Input Input contains two strings. Each string is on a separate line. example: aqua aqua Output Output YES if given two strings are the same or NO otherwise. YES
Look at the C code below. Identify the statements that contain a syntax error OR logical...
Look at the C code below. Identify the statements that contain a syntax error OR logical error. Evaluate each statement as if all previous statements are correct. Select all that apply                 #include <stdio>                 Int main()                 {                                 Float webbing;                                 Puts(“Please enter the amount of webbing per cartridge: “)                                 Scanf(“%f”, webbing);                                 Printf(“You entered: “+ webbing + “\n”);                                 Return 0;                 } Answers:                 Including the library for I/O                 Declaring a variable                 Writing...
Write the MIPS assembly version of this C code: int weird(char[] s, int x) { int...
Write the MIPS assembly version of this C code: int weird(char[] s, int x) { int i; for (i = 0; i < x; i++) { if (s[i] == ‘A’) { return power(10, i); } } return -1; } int power(int base, int i) { int j = 0; while (j < base) { base = base * base; j++; } return base; }
Write source code in C to simulate the contiguous file allocation with the following conditions: •...
Write source code in C to simulate the contiguous file allocation with the following conditions: • Prompt the user to ender the no of files • Enter the name of the file • Enter the Starting block number • Enter no of block occupied by the file i.Condition: No two files must have the same block(if the user enter the same block no present in the previous file prompt the user “Block already in use”) #include<stdio.h> #include<conio.h> struct {    ...
Write the Java source code necessary to build a solution for the problem below: Create a...
Write the Java source code necessary to build a solution for the problem below: Create a MyLinkedList class. Create methods in the class to add an item to the head, tail, or middle of a linked list; remove an item from the head, tail, or middle of a linked list; check the size of the list; and search for an element in the list. Create a test class to use the newly created MyLinkedList class. Add the following names in...
Write the Java source code necessary to build a solution for the problem below: Create a...
Write the Java source code necessary to build a solution for the problem below: Create a MyLinkedList class. Create methods in the class to add an item to the head, tail, or middle of a linked list; remove an item from the head, tail, or middle of a linked list; check the size of the list; and search for an element in the list. Create a test class to use the newly created MyLinkedList class. Add the following names in...
Write the Java source code necessary to build a solution for the problem below: The Fibonacci...
Write the Java source code necessary to build a solution for the problem below: The Fibonacci numbers form a sequence where each number is the sum of the previous two numbers. Starting from 0 and 1, the first eight Fibonacci numbers are built in the following list using the equation Fn = Fn-1 + Fn-2: 0, 0 0, 1 1, 1 1, 2 2, 3 3, 5 5, 8 8, 13 The sequence would be the numbers in red (0,...
Programming in C language (not C++) Write a function definition called PhoneType that takes one character...
Programming in C language (not C++) Write a function definition called PhoneType that takes one character argument/ parameter called "phone" and returns a double. When the variable argument phone contains the caracter a or A, print the word Apple and return 1099.99. When phone contains the caracter s or S print the word Samsung and return 999.99. When phone contains anything else, return 0.0.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT