Share
Explore BrainMass

C

Write a C program that synchronizes a parent and a child process.

Write a C program that synchronizes a parent and a child process in such a way that the output of the program will be: Child process, iteration: 1 Parent process, iteration: 1 Child process, iteration: 2 Parent process, iteration: 2 Child process, iteration: 3 Parent process, iteration: 3 Child process, iteration: 4 Pa

Error in C Programming Code

Below is the error message when trying to compile the code. In function `float totalSale(float, float, float)': 83 redeclaration of `float purchaseAmount' 83 `float purchaseAmount' previously declared here

Write a C Program to Capitalize the Input File Name

Have a C program prompt the user for a filename to open. Change every alphabetic character in the file name to a capital letter. Numbers and special characters should not be changed. Print the output to the screen.

You are developing a database of measured meteorological data for use in weather and climate research. Write a C program that inputs a file of site data records and determines the site with the greatest variation in temperature, and the site with the highest average wind speed for all the days in the file.

You are developing a database of measured meteorological data for use in weather and climate research. Define a structure type measured_data_t with components site_id_num (a four-digit integer), wind_speed, day_of_month, and temperature. Each site measures its data daily, at noon local time. Write a C program that inputs a

Manchester / Differential Manchester diagrams

a) Draw a diagram of the signal at point C for the first three characters "NET" encoded as required in problem 3a using NRZ-I. b) Repeat Part A using Manchester encoding. c) Repeat Part A again using Differential Manchester.

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

Population Needs

I need this program to not accept a negative birth rate, negative death rate, or a population less than 2. Please see the attached file.

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

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'

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?

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. Gi

Declarations in C

****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

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

Process Synchronization

We have 3 reusable resources. A,B,C. We have 3 process X,Y,Z, and each one of them uses periodically 2 of these 3 resources. Proc. X takes A, then B and then uses both A,B and then releases them. Proc. Y takes B, then C and then uses both B,C and then releases them. Proc. Z takes C, then A and then uses both C,A and then rel

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) {