online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import java.util.*; public class Main { public static void main(String[] args) { int location, wattage, employees, acres; Scanner scan = new Scanner(System.in); System.out.println("Which best describes your company location? (1- urban, 2- suburban, 3- rural)"); location = scan.nextInt(); if(location > 3){ System.out.println("Please enter a valid number."); } System.out.println("What is the monthly wattage of your company? This information is found on your company’s utility bill. (1- 100 to 1,600 kWh monthly, 2- 1700 to 3,300 kWh monthly, 3- 3,400+ kWh monthly )"); wattage = scan.nextInt(); if(wattage > 3){ System.out.println("Please enter a valid number."); } System.out.println("What is the number of employees in your company? (1- 1 to 300 employees, 2- 300 to 500 employees, 3- 500 to 1000+ employees)"); employees = scan.nextInt(); if(employees > 3){ System.out.println("Please enter a valid number."); } System.out.println("How many acres of flat land does your company own? (1- 1 to 80 acres, 2- 80+ acres)"); acres = scan.nextInt(); if(acres > 2){ System.out.println("Please enter a valid number."); } if(employees == 1){ System.out.println("Your business is considered to be a small business."); System.out.println("There are two options for you to enhance your company's energy efficiency: "); System.out.println("Solar Panels and Geothermal energy sources\n"); System.out.println("Solar Panels Advantages\n"); System.out.println("Lower energy bills: The implementation of solar panels can significantly reduce monthly utility costs. In fact, small businesses in Texas can expect to save approximately $100 to $200 per month on their electricity bills after installing solar panels.\n"); System.out.println("Government incentive: The average cost of solar panel installation for small businesses can cost anywhere from $12,000 to $30,000, depending on the size of their system and the needs of their energy consumption. However, after applying a federal tax credit of 30%, this cost can be reduced to about $8,000 to $20,000. In addition to government incentives, many utility companies in Texas offer additional rebates that can further decrease installation costs.\n"); System.out.println("Low maintenance: Small businesses have more limited operational resources, so it is important for a new source of energy to be easily maintainable. Solar panels are designed to last over 25 years with minimal maintenance, and most of their potential issues are covered by warranties. They also are typically self-cleaning with rain, but it is recommended to clean them at least twice a year to get rid of dust, pollution, or debris. Luckily, the cost of cleaning typically costs between $150 to $200, which should be easily affordable for a small business.\n"); System.out.println("Solar Panels Disadvantages\n"); System.out.println("High initial cost: Initial installation costs may be too expensive for small businesses, and it may take several years to make up their original investment. The average cost of solar panel installation for small businesses can cost anywhere from $12,000 to $30,000, depending on the size of their system and the needs of their energy consumption.\n"); System.out.println("Space limitations: Small businesses typically have small rooftops, which limits their space to install solar panels. This limitation may lead to a smaller system, which may not meet the business’s energy needs.\n"); System.out.println("Weather dependency: The weather in Texas changes very often, which can make it hard to look after solar panels. The functionality of solar panels can fluctuate based on high heat and cloudy weather. High heat can mess with how solar panels work, and they only generate 30 to 50 percent of their optimal rates on cloudy days.\n"); System.out.println("Geothermal energy Advantages\n"); System.out.println("Low operating costs: Geothermal systems usually have low operating costs compared to traditional heating and cooling systems, which is good for small businesses that are trying to save money. They are also highly efficient because they convert heat into energy with very minimal waste, which leads to significant savings on energy bills over time.\n"); System.out.println("Reliability: Geothermal energy provides a stable and consistent energy supply, regardless of weather conditions. This is important for small businesses that require a steady energy supply because it ensures that heating and cooling needs are met consistently.\n"); System.out.println("Low carbon emissions: Geothermal systems produce a very low amount of greenhouse gas emissions compared to traditional heating and cooling systems, which are run by fossil fuels. This allows businesses to significantly reduce their carbon footprint, which contributes to environmental sustainability.\n"); System.out.println("Geothermal energy Disadvantages\n"); System.out.println("High initial cost: The cost for installing geothermal systems can range from $30,000 to at least $50,000, depending on the size of the system and its capabilities. This can be an issue for small businesses looking to save money.\n"); System.out.println("Potential environmental concerns: While geothermal energy systems do have a lower environmental impact compared to traditional fossil-fuel based energy, there are still risks associated with its extraction and use. If incorrectly managed, these systems can lead to land subsidence, earthquakes, and the release of harmful gasses. This may be an issue for small businesses that do not have the resources to properly manage these issues.\n"); System.out.println("Limited scalability: The capacity of geothermal systems may be hard to expand once they are installed. This can be an issue for small businesses that are actively growing because it can lead to energy shortages or the need to invest in alternative energy sources, which can further complicate their effort to manage energy in a sustainable way.\n"); } else if(employees == 2){ System.out.println("Your business is considered to be a medium sized business."); if(acres == 2 && location == 3){ System.out.println("There are three options for you to enhance your company's energy efficiency: "); System.out.println("Solar, Biomass, and Wind energy sources\n"); System.out.println("Solar Panels Advantages\n"); System.out.println("Lower energy bills: The implementation of solar panels can significantly reduce monthly utility costs. In fact, medium businesses in Texas can expect to save approximately $500 to $1,000 per month on their electricity bills after installing solar panels.\n"); System.out.println("Government incentive: The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption. However, after applying a federal tax credit of 30%, this cost can be reduced to about $20,000 to $70,000. In addition to government incentives, many utility companies in Texas offer additional rebates that can further decrease installation costs.\n"); System.out.println("Low maintenance: Medium businesses have more limited operational resources, so it is important for a new source of energy to be easily maintainable. Solar panels are designed to last over 25 years with minimal maintenance, and most of their potential issues are covered by warranties. They also are typically self-cleaning with rain, but it is recommended to clean them at least twice a year to get rid of dust, pollution, or debris. Luckily, the cost of cleaning typically costs between $150 to $200, which should be easily affordable for a medium busines\n"); System.out.println("Solar Panels Disadvantages\n"); System.out.println("High initial cost: Initial installation costs may be too expensive for medium businesses, and it may take several years to make up their original investment. The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption.\n"); System.out.println("Space limitations: Medium businesses typically have small rooftops, which limits their space to install solar panels. This limitation may lead to a smaller system, which may not meet the business’s energy needs.\n"); System.out.println("Weather dependency: The weather in Texas changes very often, which can make it hard to look after solar panels. The functionality of solar panels can fluctuate based on high heat and cloudy weather. High heat can mess with how solar panels work, and they only generate 30 to 50 percent of their optimal rates on cloudy days.\n"); System.out.println("Biomass Advantages\n"); System.out.println("Resource Viability: It is viable to maintain the regeneration rates of the source with its usage. The company would have to replace the materials they use. This would include replanting trees or other greenery to make up for what’s being taken.\n"); System.out.println("Multi-use system: This energy source would double as a disposal measure. The practice of biomass energy involves burning material and animals in order to create fuel in the form of heat or compressed liquid. Considering the large costs associated with waste disposal, utilizing the biodegradable trash would give the company greater resources to burn and make energy.\n"); System.out.println("Demand Flexibility: Increases grid flexibility because bioenergy plants are dispatchable. This would mean that the energy can be stored to be used on demand. Biomass would depend on availability of resources, and not something not totally predictable like weather. Additionally, power plants can adjust to provide the appropriate levels of electricity demand.\n"); System.out.println("Biomass Disadvantages\n"); System.out.println("Air pollutant risks: Burning plant and animal matter will release particulate matter, carbon dioxide, and various other carbon compounds into the air. Inside an enclosed area, breathing in these pollutants can severely impact the air quality and human health. \n"); System.out.println("Risk of Deforestation: If trees or plant matter isn’t planted to replace the materials taken- deforestation can occur. This would negatively impact the environment, biodiversity, and in turn impact the quality of human lives.\n"); System.out.println("Less production efficiency: Compared with electric motors, bioenergy is almost 2-3 times less efficient in terms of vehicle transport. Bioenergy can be used to produce compressed liquid fuels to be utilized for combustion engines. If the office requires quite a bit of transportation, it would not be recommended to use bioenergy to power vehicles.\n"); System.out.println("Wind Energy Advantages\n"); System.out.println("Reduced energy costs: With wind energy costs as low as $0.01-0.02 per kilowatt-hour, medium sized businesses can potentially lower their energy expenses.\n"); System.out.println("Sustainability credentials: Using wind energy can help medium-sized businesses improve their environmental profile and appeal to eco-conscious consumers and partners.\n"); System.out.println("Potential for on-site generation: Depending on location and available space, medium businesses might be able to install their own wind turbines.\n"); System.out.println("Wind Energy Disadvantages\n"); System.out.println("Variable energy supply: The intermittent nature of wind power may be challenging for businesses with consistent energy needs.\n"); System.out.println("Initial investment: While costs have decreased, the upfront investment may still be significant for medium-sized businesses.\n"); System.out.println("Regulatory and zoning issues: Businesses may face challenges with local zoning codes or covenants when attempting to install wind turbines.\n"); } else{ System.out.println("There are two options for you to enhance your company's energy efficiency: "); System.out.println("Solar and Biomass energy sources\n"); System.out.println("Solar Panels Advantages\n"); System.out.println("Lower energy bills: The implementation of solar panels can significantly reduce monthly utility costs. In fact, medium businesses in Texas can expect to save approximately $500 to $1,000 per month on their electricity bills after installing solar panels.\n"); System.out.println("Government incentive: The average cost of solar panel installation for large businesses can easily exceed $100,000, depending on the size of their system and the needs of their energy consumption. However, after applying a federal tax credit of 30%, this cost can be reduced to about $70,000 to over $350,000. In addition to government incentives, many utility companies in Texas offer additional rebates that can further decrease installation costs.\n"); System.out.println("Low maintenance: It is important for a new source of energy to be easily maintainable for large businesses. Solar panels are designed to last over 25 years with minimal maintenance, and most of their potential issues are covered by warranties. They also are typically self-cleaning with rain, but it is recommended to clean them at least twice a year to get rid of dust, pollution, or debris. Luckily, the cost of cleaning typically costs between $150 to $200, which should be easily affordable for a large business.\n"); System.out.println("Solar Panels Disadvantages\n"); System.out.println("High initial cost: Initial installation costs may be too expensive for medium businesses, and it may take several years to make up their original investment. The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption.\n"); System.out.println("Space limitations: Medium businesses typically have small rooftops, which limits their space to install solar panels. This limitation may lead to a smaller system, which may not meet the business’s energy needs.\n"); System.out.println("Weather dependency: The weather in Texas changes very often, which can make it hard to look after solar panels. The functionality of solar panels can fluctuate based on high heat and cloudy weather. High heat can mess with how solar panels work, and they only generate 30 to 50 percent of their optimal rates on cloudy days.\n"); System.out.println("Biomass Advantages\n"); System.out.println("Resource Viability: It is viable to maintain the regeneration rates of the source with its usage. The company would have to replace the materials they use. This would include replanting trees or other greenery to make up for what’s being taken.\n"); System.out.println("Multi-use system: This energy source would double as a disposal measure. The practice of biomass energy involves burning material and animals in order to create fuel in the form of heat or compressed liquid. Considering the large costs associated with waste disposal, utilizing the biodegradable trash would give the company greater resources to burn and make energy.\n"); System.out.println("Demand Flexibility: Increases grid flexibility because bioenergy plants are dispatchable. This would mean that the energy can be stored to be used on demand. Biomass would depend on availability of resources, and not something not totally predictable like weather. Additionally, power plants can adjust to provide the appropriate levels of electricity demand.\n"); System.out.println("Biomass Disadvantages\n"); System.out.println("Air pollutant risks: Burning plant and animal matter will release particulate matter, carbon dioxide, and various other carbon compounds into the air. Inside an enclosed area, breathing in these pollutants can severely impact the air quality and human health. \n"); System.out.println("Risk of Deforestation: If trees or plant matter isn’t planted to replace the materials taken- deforestation can occur. This would negatively impact the environment, biodiversity, and in turn impact the quality of human lives.\n"); System.out.println("Less production efficiency: Compared with electric motors, bioenergy is almost 2-3 times less efficient in terms of vehicle transport. Bioenergy can be used to produce compressed liquid fuels to be utilized for combustion engines. If the office requires quite a bit of transportation, it would not be recommended to use bioenergy to power vehicles.\n"); } } else{ System.out.println("Your business is considered to be a large business."); if(acres == 2 && location == 3){ System.out.println("There are three options for you to enhance your company's energy efficiency: "); System.out.println("Solar, CAES, and Wind energy sources\n"); System.out.println("Solar Panels Advantages\n"); System.out.println("Significant cost savings: The implementation of solar panels can significantly reduce monthly utility costs. In fact, large businesses in Texas can expect to save approximately $2,000 per month on their electricity bills after installing solar panels. This equates to about $24,000 saved per year.\n"); System.out.println("Government incentive: The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption. However, after applying a federal tax credit of 30%, this cost can be reduced to about $20,000 to $70,000. In addition to government incentives, many utility companies in Texas offer additional rebates that can further decrease installation costs.\n"); System.out.println("Low maintenance: Small businesses have more limited operational resources, so it is important for a new source of energy to be easily maintainable. Solar panels are designed to last over 25 years with minimal maintenance, and most of their potential issues are covered by warranties. They also are typically self-cleaning with rain, but it is recommended to clean them at least twice a year to get rid of dust, pollution, or debris. Luckily, the cost of cleaning typically costs between $150 to $200, which should be easily affordable for a medium busines\n"); System.out.println("Solar Panels Disadvantages\n"); System.out.println("High initial cost: Initial installation costs may be too expensive for medium businesses, and it may take several years to make up their original investment. The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption.\n"); System.out.println("Space limitations: Medium businesses typically have small rooftops, which limits their space to install solar panels. This limitation may lead to a smaller system, which may not meet the business’s energy needs.\n"); System.out.println("Weather dependency: The weather in Texas changes very often, which can make it hard to look after solar panels. The functionality of solar panels can fluctuate based on high heat and cloudy weather. High heat can mess with how solar panels work, and they only generate 30 to 50 percent of their optimal rates on cloudy days.\n"); System.out.println("Compressed Air Energy Storage (CAES) Advantages\n"); System.out.println("Grid Stabilization: The system can store energy during low demand times and release when the need increases. Some plants can ramp up til 58 MW/min for a 324 MW generator. The compressor would act as a response provider which can fluctuate either way. This coupled with voltage stability support makes the grid relatively reliable.\n"); System.out.println("Long Lifespan: The technology has existed for over 40 years. According to the UN Climate Technology Centre & Network, since its availability in 1970 some plants have operated for over 20-24 years. The design of the plants and the commercial availability have made maintenance minimal and therefore operations feasible. \n"); System.out.println("Power reliability: In addition to the grid stabilization, the system can remedy frequency excursions in the grid. This coupled with the plants large operating range (90% in some cases) would make the grids more flexible and therefore enhance the reliability. \n"); System.out.println("CAES Disadvantages\n"); System.out.println("Geographical Requirements: The system will require underground storage. Storage can range from porous rock structures, aquifers, empty natural gas reservoirs, and salt caverns. The site criteria are a bit more specific, including needing: proximity to natural gas pipelines, transition lines, deep geologic traps. It is also recommended that storage installation occurs in areas that have already been drilled. \n"); System.out.println("Low system efficacy: While the energy produced is clean and available on demand, it is difficult to store. While increasing the air pressure, the energy density improves at the cost of system efficacy. There is a trade off between storage size and efficacy. \n"); System.out.println("Limited Storage Efficacy: While charging the traditional system, large amounts of heat are dispelled and replaced by the combustion heat produced during power generation. This shows that storage efficiency is quite limited and can be improved upon.\n"); System.out.println("Wind Energy Advantages\n"); System.out.println("Grid Integration: Since wind turbine farms are large scale operations that feed into grids, large offices can benefit by purchasing this energy through utility providers. Or they can go to the source by getting a PPA (power purchase agreements) with wind farm operators. \n"); System.out.println("Technological Improvements: As of late, especially in Texas, it is very important to prepare the turbines for unpredictable weather. Cost effective solutions include installing longer blades, chemical pre-coats, and de-icing technologies like heaters and vibration systems. Such advancements will ensure higher reliability. \n"); System.out.println("Economic viability: Wind energy has become more financially friendly than fossil fuels in the 21st century. The levelized cost of electricity (LCOE) for some projects can come as low as 6.4 cents per KW/hr.\n"); System.out.println("Wind Energy Disadvantages\n"); System.out.println("Scale & Location: Wind turbine farms need typically 80 acres minimum. Additionally, these large scale operations work best on flat land with plenty of access to constant wind resources. Such conditions are mostly found outside urban areas. \n"); System.out.println("Initial costs: While maintenance and production costs are quite low, initial costs to create these farms can be exorbitant. The upfront costs include: manufacturing, transporting, and installation.\n"); System.out.println("Regulatory and zoning issues: Businesses may face challenges with local zoning codes or covenants when attempting to install wind turbines.\n"); } else{ System.out.println("There are two options for you to enhance your company's energy efficiency: "); System.out.println("Solar and CAES energy sources\n"); System.out.println("Solar Panels Advantages\n"); System.out.println("Significant cost savings: The implementation of solar panels can significantly reduce monthly utility costs. In fact, large businesses in Texas can expect to save approximately $2,000 per month on their electricity bills after installing solar panels. This equates to about $24,000 saved per year.\n"); System.out.println("Government incentive: The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption. However, after applying a federal tax credit of 30%, this cost can be reduced to about $20,000 to $70,000. In addition to government incentives, many utility companies in Texas offer additional rebates that can further decrease installation costs.\n"); System.out.println("Low maintenance: Small businesses have more limited operational resources, so it is important for a new source of energy to be easily maintainable. Solar panels are designed to last over 25 years with minimal maintenance, and most of their potential issues are covered by warranties. They also are typically self-cleaning with rain, but it is recommended to clean them at least twice a year to get rid of dust, pollution, or debris. Luckily, the cost of cleaning typically costs between $150 to $200, which should be easily affordable for a medium busines\n"); System.out.println("Solar Panels Disadvantages\n"); System.out.println("High initial cost: Initial installation costs may be too expensive for medium businesses, and it may take several years to make up their original investment. The average cost of solar panel installation for small businesses can cost anywhere from $30,000 to $100,000, depending on the size of their system and the needs of their energy consumption.\n"); System.out.println("Space limitations: Medium businesses typically have small rooftops, which limits their space to install solar panels. This limitation may lead to a smaller system, which may not meet the business’s energy needs.\n"); System.out.println("Weather dependency: The weather in Texas changes very often, which can make it hard to look after solar panels. The functionality of solar panels can fluctuate based on high heat and cloudy weather. High heat can mess with how solar panels work, and they only generate 30 to 50 percent of their optimal rates on cloudy days.\n"); System.out.println("Compressed Air Energy Storage (CAES) Advantages\n"); System.out.println("Grid Stabilization: The system can store energy during low demand times and release when the need increases. Some plants can ramp up til 58 MW/min for a 324 MW generator. The compressor would act as a response provider which can fluctuate either way. This coupled with voltage stability support makes the grid relatively reliable.\n"); System.out.println("Long Lifespan: The technology has existed for over 40 years. According to the UN Climate Technology Centre & Network, since its availability in 1970 some plants have operated for over 20-24 years. The design of the plants and the commercial availability have made maintenance minimal and therefore operations feasible. \n"); System.out.println("Power reliability: In addition to the grid stabilization, the system can remedy frequency excursions in the grid. This coupled with the plants large operating range (90% in some cases) would make the grids more flexible and therefore enhance the reliability. \n"); System.out.println("CAES Disadvantages\n"); System.out.println("Geographical Requirements: The system will require underground storage. Storage can range from porous rock structures, aquifers, empty natural gas reservoirs, and salt caverns. The site criteria are a bit more specific, including needing: proximity to natural gas pipelines, transition lines, deep geologic traps. It is also recommended that storage installation occurs in areas that have already been drilled. \n"); System.out.println("Low system efficacy: While the energy produced is clean and available on demand, it is difficult to store. While increasing the air pressure, the energy density improves at the cost of system efficacy. There is a trade off between storage size and efficacy. \n"); System.out.println("Betz’s Law limitation: Betz’s law states that the theoretical efficiency of a wind turbine cannot exceed more than 59.3%. This means that at most 59.3% of the kinetic energy would spin the turbine and generate electricity.\n"); } } } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue