Explore BrainMass


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

Miracle C Example Questions

3 Miracle C Questions, see attached. 1. Between structured programming and OOP, which do you feel would require more preparation prior to coding? Justify your answer. 2. Can you have an array of arrays? If so, give a detailed example of when you would use one. 3. What are the purposes of the following three functions?

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'

Paper Rock Scissors Game in C

Modify the attached program to not just say you won, lost, or tied but to say how, no matter if you win, lose, or tie. For example, You chose paper and I chose rock. You win. You chose rock and I chose paper. You lose. See the attached files.

Test Program in C

****THIS NEEDS TO BE IN "C" NOT C++**** Consider the following code: int a=1,b=2,c=3: a+=b+=c+=7; What are values of a, b, and c? Write a test program in "C" to check it.

Outputed Characters in C

***This is in C*** Given abcdefghi as input char Ch='/'; while (Ch !='d') { putchar (Ch); Ch = getchar(); } What characters are outputed? abc, d, /abc, or /efghi Totally lost with this one (/efghi perhaps)

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

Correctly Invoke Function

This is "C" programming. I think the answer is "e" but the text book I'm using seems to address everything but something that turns the light bulb on and says "Yes, you got it". Not sure where the "N" fits in without a valid statement after the int F (void). I'm probably trying to look too deep into the question. Given the

Declarations in C Programming

****This is "C" Programming**** I selected "b" but I've always seem to get lost doing Boolean. Assuming the following declarations: int A=1, B=2, C=3, D=4; What is the value of the following (Boolean) expression? C == D || B > A && C a. 0 b. 1 c. There is a syntax error in the expression. d. There is no

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