Loading
Home › Computer Science Help › NEEDS TO BE IN STANDARD ANCI in .c code INTRODUCTION: Whe...
Status: Completed

NEEDS TO BE IN STANDARD ANCI in .c code INTRODUCTION: When electricity is transmitted through voltage lines, losses occur due to electrons colliding, converting their energy into heat. To minimize these losses, generally current is transmitted over long distances at high voltage; higher currents lead to heat losses, and low currents require high voltage (Ohm's law). These losses scale with the square of a wire's current. (As a note: this is why AC current is used in power transmission - it is less lossy than DC current.) The power loss can be calculated using the following equations: where: i = current (amps) r = resistance (ohms/mile) R = total resistance (ohms) ASSIGNMENT: Write a C program that will first allow the user to enter the line resistance in ohms/mile and the power transmitted in kW. The program needs to ensure that line resistance is between 0.04 and 0.07 ohms/mile and power transmitted is between 475 and 525 kW; if either of these is not, it should print an error message and the program should end. If the values are acceptable, the program should compute the power loss for power transmitted from a station to cities at distances of 15, 30, 45, ..., 150 miles at 100 V and 200 V. Use a while loop to control voltage (initialize at 100.0 and increment by 100.0 to 200.0) and a nested for loop to control distance (initialize at 15.0 and increment by 15.0 to 150.0). The voltage, distance, and power loss should print to the screen. Your program output will look like the illustration shown below. Use your PC's cursor to determine the horizontal and vertical spacing for the output format. NOTE: Use proper variable names. No single letter variables will be accepted. SAMPLE OUTPUT FORMAT: ******************************************** POWER LOSS IN TRANSMISSION LINE Enter line resistance in ohms/mile: x Enter transmitted power in kW : x RESULTS Voltage = 100.0 volts Distance (mi) Power loss (Watts) 15.0 X.XXXEXXXX 30.0 X.XXXEXXXX 45.0 X.XXXEXXXX 60.0 X.XXXEXXXX . . . . . . 150.0 X.XXXEXXXX Voltage = 200.0 volts Distance (mi) Power loss (Watts) 15.0 X.XXXEXXXX 30.0 X.XXXEXXXX 45.0 X.XXXEXXXX 60.0 X.XXXEXXXX . . . . . . 150.0 X.XXXEXXXX ********************************************

Date Posted: 12/10/2016
Category: Computer Science
Due Date: 12/10/2016
Instruction
NEEDS TO BE IN STANDARD ANCI in .c code INTRODUCTION: When electricity is transmitted through voltage lines, losses occur due to electrons colliding, converting their energy into heat. To minimize these losses, generally current is transmitted over long distances at high voltage; higher currents lead to heat losses, and low currents require high voltage (Ohm's law). These losses scale with the square of a wire's current. (As a note: this is why AC current is used in power transmission - it is less lossy than DC current.) The power loss can be calculated using the following equations: where: i = current (amps) r = resistance (ohms/mile) R = total resistance (ohms) ASSIGNMENT: Write a C program that will first allow the user to enter the line resistance in ohms/mile and the power transmitted in kW. The program needs to ensure that line resistance is between 0.04 and 0.07 ohms/mile and power transmitted is between 475 and 525 kW; if either of these is not, it should print an error message and the program should end. If the values are acceptable, the program should compute the power loss for power transmitted from a station to cities at distances of 15, 30, 45, ..., 150 miles at 100 V and 200 V. Use a while loop to control voltage (initialize at 100.0 and increment by 100.0 to 200.0) and a nested for loop to control distance (initialize at 15.0 and increment by 15.0 to 150.0). The voltage, distance, and power loss should print to the screen. Your program output will look like the illustration shown below. Use your PC's cursor to determine the horizontal and vertical spacing for the output format. NOTE: Use proper variable names. No single letter variables will be accepted. SAMPLE OUTPUT FORMAT: ******************************************** POWER LOSS IN TRANSMISSION LINE Enter line resistance in ohms/mile: x Enter transmitted power in kW : x RESULTS Voltage = 100.0 volts Distance (mi) Power loss (Watts) 15.0 X.XXXEXXXX 30.0 X.XXXEXXXX 45.0 X.XXXEXXXX 60.0 X.XXXEXXXX . . . . . . 150.0 X.XXXEXXXX Voltage = 200.0 volts Distance (mi) Power loss (Watts) 15.0 X.XXXEXXXX 30.0 X.XXXEXXXX 45.0 X.XXXEXXXX 60.0 X.XXXEXXXX . . . . . . 150.0 X.XXXEXXXX ********************************************
Bidders
Essaymasters 9 years, 9 months ago
Rated 8.94 earned 80799.14 around 2500 assignments.
I WILL DO THIS ASSIGNMENT FOR YOU....THANKS
$100.00
  • in standard ANCI and not C++ and make the output exactly as the word document shows? also how long would this take?
    User_10438 | Dec 10, 2016, 22:30 PM
  • In the next 12 to 15 hours I will be done..thanks
    Essaymasters | Dec 10, 2016, 22:34 PM
  • okay needed it done sooner than that since it is due today.
    User_10438 | Dec 10, 2016, 22:36 PM
  • Alright
    Essaymasters | Dec 10, 2016, 22:37 PM
  • Kindly, assign so that I start working on it..thanks
    Essaymasters | Dec 10, 2016, 22:41 PM
  • 100 the lowest you will go?
    User_10438 | Dec 10, 2016, 22:44 PM
  • It is an urgent order and I will need to put everyone aside and prioritize you my dear...thanks
    Essaymasters | Dec 10, 2016, 22:46 PM
  • will do can i get a time that you will have it done by before i assign it to you please?
    User_10438 | Dec 10, 2016, 22:52 PM
  • Exactly 12 hours from now...
    Essaymasters | Dec 10, 2016, 22:53 PM
  • that wont work i need it done in the next few hours...think that is fair for the 100 bucks
    User_10438 | Dec 10, 2016, 22:54 PM
  • like i said it is due today
    User_10438 | Dec 10, 2016, 22:54 PM
  • so will 6 hours be good for you??
    Essaymasters | Dec 10, 2016, 22:58 PM
  • 6 hours will work. do i get to see the product before paying?
    User_10438 | Dec 10, 2016, 22:59 PM
  • Yes of course but before I start working on it you will have to assign me the work...thanks
    Essaymasters | Dec 10, 2016, 23:00 PM
  • alright the sooner the better...if done early will definatly use you again and recomend you to a few friends as well thank you
    User_10438 | Dec 10, 2016, 23:01 PM
  • alright the sooner the better...if done early will definatly use you again and recomend you to a few friends as well thank you
    User_10438 | Dec 10, 2016, 23:01 PM
  • ok
    Essaymasters | Dec 10, 2016, 23:03 PM
  • and the sonner will also increase a possible bonus if it is all accurate as well. thank you very much
    User_10438 | Dec 10, 2016, 23:04 PM
  • alright
    Essaymasters | Dec 10, 2016, 23:05 PM
  • hello Essaymaster!! how is it coming along?
    User_10438 | Oct 13, 2016, 02:04 AM
  • i am almost done
    Essaymasters | Oct 13, 2016, 03:26 AM
  • awesome. thank you for keeping in contact. alot of people have bad communication. you are definitely getting a good rating in communication
    User_10438 | Oct 13, 2016, 03:28 AM
  • hello. how is it going?
    User_10438 | Oct 13, 2016, 05:05 AM
  • could you please contact me or reply
    User_10438 | Oct 13, 2016, 05:38 AM
  • hey now i am testing abd debugging
    Essaymasters | Oct 13, 2016, 06:30 AM
  • just a few minutes and i upload
    Essaymasters | Oct 13, 2016, 06:31 AM
  • alright, i try not to be so needy and bug you but it is pretty vital to get this done so i appreciate the help i really do
    User_10438 | Oct 13, 2016, 06:32 AM
  • i understand
    Essaymasters | Oct 13, 2016, 06:33 AM
  • hey dear i have uploaded for you kindly, check on it
    Essaymasters | Oct 13, 2016, 07:53 AM
  • and on the author I filled my name kindly, remember to replace it with yours
    Essaymasters | Oct 13, 2016, 07:55 AM
  • i needed it is standard ansi like not this probloem but this type of look /* Preprocessor directives */ #include <stdio.h> #include <math.h> /* Main function */ int main(void) { /* Declare variables */ int student_code; /* Print headings */ printf("********************************************"); printf("\n Student Classifications"); /* Input values */ printf("\n\nEnter student classification code (1-4): "); scanf("%d",&student_code); /* Check student code and print output */ printf("Student code = %d\n", student_code); switch(student_code) { case 1: printf("The student is a freshman.\n"); break; case 2: printf("The student is a sophomore.\n"); break; case 3: printf("The student is a junior.\n"); break; case 4: printf("The student is a senior.\n"); break; default: printf("The student is unclassified.\n"); } /* Exit the program */ return 0; }
    User_10438 | Oct 13, 2016, 08:01 AM
  • ok i will check on that
    Essaymasters | Oct 13, 2016, 08:06 AM
  • like can you uplode the .c file that you did
    User_10438 | Oct 13, 2016, 08:07 AM
  • oooh i understand now because i thought its a problem with the instructions i followed
    Essaymasters | Oct 13, 2016, 08:15 AM
  • just a minute n i upload
    Essaymasters | Oct 13, 2016, 08:17 AM
  • Kindly, check I have uploaded it and release the payment, regards
    Essaymasters | Oct 13, 2016, 08:22 AM
  • this program does not work at all
    User_10438 | Oct 13, 2016, 08:24 AM
  • did you run well cause at my end its working perfectly.
    Essaymasters | Oct 13, 2016, 08:26 AM
  • the #include<iostream> is not a thing in standard ansi it uses #include <stdio.h> #include <math.h>
    User_10438 | Oct 13, 2016, 08:27 AM
  • just give me a minute I counter check
    Essaymasters | Oct 13, 2016, 08:28 AM
  • in standard ANSI?? there are so many errors that it wont even compile
    User_10438 | Oct 13, 2016, 08:28 AM
  • just a minute pliz
    Essaymasters | Oct 13, 2016, 08:28 AM
  • like if you read the instructions that doesn't even look like .c code in standard ANSI and it has no printf or scanf or any of that
    User_10438 | Oct 13, 2016, 08:29 AM
  • Dear kindly, use this "eclipse' and it will run as it is or do you want me to send screen shots of how it has worked
    Essaymasters | Oct 13, 2016, 08:30 AM
  • look at your code i uploaded and can you try to compile that and run it
    User_10438 | Oct 13, 2016, 08:34 AM
  • ok
    Essaymasters | Oct 13, 2016, 08:35 AM
  • bro it works cin na count are the substitutes of the prinf and scanf
    Essaymasters | Oct 13, 2016, 08:39 AM
  • so present as I send it and you will pass...I took my time and it is perfect....
    Essaymasters | Oct 13, 2016, 08:40 AM
  • the instructions have an output format. ycin and count arent the C code standard ansi format
    User_10438 | Oct 13, 2016, 08:41 AM
  • i cant present it because i cant compile it or run it cause it isnt in standard ansi formoat and it says iostream is not found in the file
    User_10438 | Oct 13, 2016, 08:43 AM
  • now do I sent you screen shots
    Essaymasters | Oct 13, 2016, 08:46 AM
  • what are you using to run the file cause i sent you the code and if you open that code and run it just like you have it it wont work
    User_10438 | Oct 13, 2016, 08:48 AM
  • there are no floats for the numbers and even if it did work the output format has to look like the instructions and that isnt even in there
    User_10438 | Oct 13, 2016, 08:50 AM
  • alright ...just give me an hour I will check on it and use a different platform to run it ....
    Essaymasters | Oct 13, 2016, 08:51 AM
  • and use printf and scanf and #include <stdio.h> #include <math.h> instead of #include<iostream> i am using DEV C++ as the program and need it to be written it in .c
    User_10438 | Oct 13, 2016, 08:54 AM
  • did you check the screen shots
    Essaymasters | Oct 13, 2016, 08:59 AM
  • i see your screenshots but 1. that output isnt what the instructions say and it states in ANSI format so like printf and scanf what you are doing isnt in ansi format and the output is not correct
    User_10438 | Oct 13, 2016, 08:59 AM
  • i see your screenshots but 1. that output isnt what the instructions say and it states in ANSI format so like printf and scanf what you are doing isnt in ansi format and the output is not correct
    User_10438 | Oct 13, 2016, 08:59 AM
  • i see the screenshots....it doesnt run on mine cause you arent using C code
    User_10438 | Oct 13, 2016, 09:00 AM
  • are you not going to do it?
    User_10438 | Oct 13, 2016, 09:06 AM
  • I am checking on it....
    Essaymasters | Oct 13, 2016, 09:07 AM
  • like rewritting it so the output looks right and it is in standard ansi format and uses print f and scanf and math.h and stdio.h?
    User_10438 | Oct 13, 2016, 09:09 AM
  • ok
    Essaymasters | Oct 13, 2016, 09:11 AM
  • trust me if it is how the instructions say it needs to be then i will release the money and give you a 10 rating
    User_10438 | Oct 13, 2016, 09:12 AM
  • that didnt have a while loop in their either like the instructions asked for
    User_10438 | Oct 13, 2016, 09:13 AM
  • hate to keep bugging but are you able to write it like that or not?
    User_10438 | Oct 13, 2016, 09:46 AM
  • Hey dear check the one I upload now....and tell me now it should be perfect.
    Essaymasters | Oct 13, 2016, 10:14 AM
  • Run the code on windows because of the 'system("cls")' command in the source code
    Essaymasters | Oct 13, 2016, 10:17 AM
  • says either power or resistance is invalid no matter what numbers i put in. do you know why? or have numbers i can put in that wont show that msg?
    User_10438 | Oct 13, 2016, 10:21 AM
  • Is everything else ok..so I check on that issue
    Essaymasters | Oct 13, 2016, 10:24 AM
  • I had compiled 2 versions I want you to check on the other one as I check on the matter with the first one.....
    Essaymasters | Oct 13, 2016, 10:25 AM
  • i mean if you click on the orginal attachment i have...that is what the run screen should look like...that program is on the right track for sure and by floats i meant like %1.7E in the scanf line....much better. that one doesnt give me errors but it isnt quite there...if it gets to where it needs to be there will be a bonus for sure
    User_10438 | Oct 13, 2016, 10:26 AM
  • ok
    Essaymasters | Oct 13, 2016, 10:27 AM
  • can I upload for you the other version as I check on that...
    Essaymasters | Oct 13, 2016, 10:29 AM
  • what do you mean?
    User_10438 | Oct 13, 2016, 10:35 AM
  • ok The first number you enter should be a float and within the range of 0.04 - 0.07.The second entry should be an integer (without decimals) and within the range of 475 - 525. I want you to try that
    Essaymasters | Oct 13, 2016, 10:37 AM
  • dear please i need to hear from you i have not slept and i want to make sure that you are sorted
    Essaymasters | Oct 13, 2016, 10:44 AM
  • Try entering 0.04 for resistance and 500 for power. It works I have just used an online compiler and it worked . http://www.tutorialspoint.com/compile_c_online.php
    Essaymasters | Oct 13, 2016, 10:46 AM
  • okay entering those work. have you looked at the float part of it? or why are there two main bodies? just a couple questions
    User_10438 | Oct 13, 2016, 10:58 AM
  • Now dear if you are good just let me be ...next time I will be able to explain everything you know this work had no much time...
    Essaymasters | Oct 13, 2016, 11:01 AM
  • ok dear release the payment and the bonus u promised I will explain after that be fair
    Essaymasters | Oct 13, 2016, 11:08 AM
  • the only value that is of type float is resistance. I have put two functions ; main and user_input. Although , all the code could still be written in main. try out entering all possible values that can be entered.
    Essaymasters | Oct 13, 2016, 11:21 AM
  • ok dear release the payment and the bonus u promised
    Essaymasters | Oct 13, 2016, 11:22 AM
  • okay entering those work. have you looked at the float part of it? or why are there two main bodies? just a couple questions
    User_10438 | Oct 17, 2016, 04:31 AM
  • the only value that is of type float is resistance. I have put two functions ; main and user_input. Although , all the code could still be written in main. try out entering all possible values that can be entered.
    Essaymasters | Oct 17, 2016, 06:21 AM
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}