Share
Explore BrainMass

C

Grammar in Chomsky Normal Form

Let G be the grammar S -> ASB | e A -> aAS | a B -> SbS | A |bb "e" in first rule indicates Epsilon or empty string. Put G into Chomsky normal form.

Example of C Pointers

Given the declaration; int x; int *p; int *q; Mark the following statements that are invalid only. Then explain why it is invalid. p=q; Answer: *p=56; Answer: p=x; Answer: *p=*q; Answer: q = &x; Answer: *p = q; Answer:

C Language Coding

Design and code an ANSI Standard C program which enhances the code at end of post to do the following: First using a for loop (with two iterations): a Ask for a Fahrenheit temperatures from the user . b Get a Fahrenheit temperatures from the user and to store it in an fArray. c Convert the temperatures to its Centigrade

Program Functions

Program Functions Design and code an ANSI Standard C program which enhances the code below only so as to make it a modular program. (each of the program four tasks of ask, get, alter and display are now separate functions). This will necessitate designing appropriate ask, get, alter and display functions. It will also nece

The Concept of Modularization in Computer Programming

Explain modularization as used in computer programming. How do programmers use modules in computer programming to solve problems? Give an example of using modules to develop a program to track attendance in multiple classes at school. Looking for original information/thoughts, nothing copied directly from the internet can you h

A recursive C function to detect palindromes

A palindrome consists of a word or deblanked, unpunctuated phrase that is spelled exactly the same when the letters are reversed. Write a recursive function that returns a value of 1 if its string argument is a palindrome. Notice that in palindromes such as level, deed, sees, and Madam I'm Adam(madamimadam), the first letter ma

Write a C function to accept an integer number

Write a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups. The passed integer represents the total number of cups, and the function is to determine the number of gallons, quarts, pints, and cups in the passed value. Using the passed addresses, the fu

C program to determine the year entered is a leap year

Write a C program to determine whether the year entered from the keyboard is a leap year. Display a message indicating whether the year is or is not a leap year. To calculate this problem, a year is a leap year if it is evenly divisible by 4 and not by 100, or if it is evenly divisible by 400. Check the remainder of the divi

C Program to Display in Words What Number is Entered

Write C program to display in words what number is entered when a single digit is entered. Ask the user to enter a digit between 0 and 9. Have the program print out the digit in words, for example: Enter a digit between 0 and 9: 4 You entered the number four Assume that the user will enter only a single digit. The user

Write a C program (Use Miracle C compiler)

Write a C program that displays a title, "Currency Conversion," and then write the names of five currencies and their equivalents to the US dollar. The conversions are hard coded equations. Insert comments in the program to document the program internally. Attach a design flow chart (in MS Word, not Visio). Submit the source c

Shift variables in a circular fashion

Please help with the following problem. This needs to be in "C" Write a function that shifts the stored value of five character variables in a circular fashion. Your function should work in the following way. Suspose that C1, C2, C3, C4, C5 are variables of type char, and suspose that the values of these variables are 'A'

One of the functions in C program is special - this is the main() function.

Can you please help me with the following study question? Thanks One of the functions in C program is special - this is the main() function. What is so special about it? What differs main() from any other function which may be present in your program? Should every function be executed when the program runs?

What are the available data types in the C language?

I have a study question that I need help with thanks. What are the available data types in the C language? Why do we have so many of them? Can you use just one data type in the whole program? If yes, what would be advantages and disadvantages of that?

Input and Output Processing in C Language

Can you please help me answer the following study question? Thanks. How is the input and output processing structured in the C language? How can you display some combination of words and numbers on the computer's screen? How to get information from a keyboard to be used in your program? What are Output Format characters?

Write a structured C program implementing a simple three rotor Enigma Machine. The program should compile warning free with 'gcc -Wall -ansi', and should support a command line argument '-vvv' to enable detailed debugging messages.

Write a software implementation of a simple three rotor Enigma Machine. Please refer to the following wikipedia entries for the Enigma Machine and the Enigma Rotor details. http://en.wikipedia.org/wiki/Enigma_machine http://en.wikipedia.org/wiki/Enigma_rotor_details For the current implementation, consider only the rotors

Differences between C and C++ languages

What are the major differences between C and C++ languages? What do you need to learn in a programming language, such as C, in order to use it effectively in problem solving?

Examples of Loops in C: While-Do, Do-Until and For-Loop

NOTE: C coding is fine. Please explain the process. Senario: For many years, your Uncle Frank has been running a small landscaping business. Through these years, he acquired many steady clients and knew most of them on a first name basis. Once a month, after completing the work for that day, he would calculate (on the spot) h

Reverse Polish to Infix

Convert the following formulas from reverse Polish to infix: a. AB + C + D x b. AB/CD/ + c. ABCDE + x x / d. ABCDE + F/ + G - H/x +

The Direction of Passing Parameters in C

Let the function fun be defined as: int fun(int *k) { *k += 4; return 3 * (*k) - 1; } Suppose fun is used in a program as follows: void main() { int I = 10, j = 10, sum1, sum2; sum1 = (I / 2) + fun(&i); sum2 - fun(&j) + (j / 2); } What are the values of sum1 and sum2? a. If the operands in the ex

Relations - Determinants - Dependencies

Consider the following relation definition and sample data: EmployeeName PeojectID TaskID Phone TotalHours Don 100A B-1 12345 12 Don 100A P-1 12345 12 Don 200B B-1 1345 12 Don 200B P-1 12345 12 Pam 100A C-1 67890 26 Pam 200A C-1 67890 26 Pam 200D C-1 67890 26 PROJECT-HOURS (EmployeeName, ProjectID, Tas

Information Technology & Business Multiple Choice

1. Some global enterprises engage in joint research projects to broaden their contacts. What is another reason? A) to reduce risk B) to ease barriers to entry C) to increase costs D) to decrease certainty E) to increase competitive complexity 2. Political factors in choosing a foreign manufacturing site i

Forking of new processes

[A] What happens when you run the following piece of code: main(int argc, char ** argv) { for(;;) fork(); } [B] Given the following piece of code: main(int argc, char ** argv) { int child = fork(); int c = 5; if(child == 0) {

Excel 2003 Multiple Choice

1. The primary object in a MS Access database for collecting and storing data is a: a. record b. field c. file d. table e. database 2. Each individual entry in a database is stored as a: a. field b. table c. record d. file e. page 3. Records are stored in a database file as a: a. row b. column c. s

CSCI Excel 2003 Multiple Choice

1. Which of the following enables you to calculate the input value required to yield a desired outcome result? a. Tools, Goal seek b. Insert, Goal seek c. Format, Goal seek d. Tools, Options, Goal seek e. Data, Goal seek Save Answer 2. Which of the following belong in the Goal Seek dialog box? a. By changing cell