Answer:
It goes like:
public class Program
{
public static void main(String[] args)
{
int j=18;
int sum=0;
for (int i =1; i<7; i++)
{
sum=sum+(i*(j-2));
j=j-2;
}
System.out.println(sum);
}
}
Explanation:
<u>Variables used: </u>
j : controls the first number in product and decreases by 2 each time the loop runs.
sum: saves the values of addition as the loop runs.
Answer:
#include<stdio.h>
void ConvertFahrenheit(float);
void main()
{
float fahrenheit_temp;
printf("Input the temperature in Fahrenheit: ");
scanf("%f", &fahrenheit_temp);
ConvertFahrenheit(fahrenheit_temp);
}
void ConvertFahrenheit(float fahren) {
float c, k;
c = (fahren - 32)/1.8;
k = (fahren + 459.67)/1.8;
printf("Celsius = %f\n", c);
printf("Kelvin = %f", k);
}
Explanation:
- Inside the main function, take the temperature in Fahrenheit as an input from user and call the ConvertFahrenheit function by passing it the fahrenheit_temp variable as an argument.
- Create the ConvertFahrenheit function for the conversion and convert the fahrenheit value to the Celsius and Kelvin by using their conversion formulas respectively.
- Lastly, display the result in Celsius and Kelvin.
A motherboard is one of the most essential parts of a computer system. It holds together many of the crucial components of a computer, including the central processing unit (CPU), memory and connectors for input and output devices. The base of a motherboard consists of a very firm sheet of non-conductive material, typically some sort of rigid plastic. Thin layers of copper or aluminum foil, referred to as traces, are printed onto this sheet. These traces are very narrow and form the circuits between the various components. In addition to circuits, a motherboard contains a number of sockets and slots to connect the other components.
Answer:
Differences between Object Oriented Programming and Structured Programming
1. Structured programming focuses on process/logic then data while OOP(Object Oriented programming) focuses on data.
2.OOP supports Inheritance,Encapsulation,Abstraction,Polymorphism while structured programming does not supports these.
3.Structured programming follows top-down approach while OOP follows bottom-up approach.
4.OOP is more secured than structured programming because it supports Abstraction (data hiding).
Answer:
The paste function to use is the Advanced Paste Function that reads Use Destination Theme and Link Data or Keep Source Formatting and Link Data.
Explanation:
The first function adopts the Theme (such as colors, fonts, and other formatting) whilst retaining links to the data in the excel workbook. The latter imports the formatting or theme as-is from excel.
In both scenarios, (for as long as both documents are open and are in the same file) when the data in excel is opened and updated, it reflects automatically in the chart on the Microsoft Word document.
Cheers