Answer:
int main()
{
int A1= {5,3,4,8,9,0,7};
int SArri1 = sizeof(A1);
printf("Original array: ");
for (int i=0; i < SArri1;i++)
printf("", A1[i] );
int i, sum = 20, n= 0;
printf("\nArray pairs whose sum equal to 20: ");
for (int i=0; i<SArri1; i++)
for (int j=i+1; j<SArri1; j++)
if (A1[i]+A1[j] == sum)
{
Printf(“\n”, array1[i])
Printf(“,”,array1[j]);
n++;
}
printf("\nNumber of pairs whose sum equal to 20: ",n)
return 0;
}
Explanation:
First of all, you should create the array of integers, and put random numbers. Then you have to save in a constant the size of the array (in this code is called SArr1) With a for you can print all the numbers that are on the array because then you will print all array pairs whose sum is equal to a specified numer. in this code we are going to use 20.
then with a condition (if) you are going to compare one of number of the array with all the others and check if its equal to 20. If yes, it going to print the numbers that answer to that condition and it's going to add +1 to the variable n (for this you will need to use two bucles for)
Then you can print the number of pairs whose sum is equal to 20 by printing n
Answer:
a. Availability of software licensing
Explanation:
With feasibility analysis, we take into consideration economic, technical, legal, and scheduling factors to make sure that our project completes successfully. Acquiring license for a software can be free of cost or paid subscription. So a business analyst needs to make an account of the cost of accessing the software services. Also while automating a software installation process, it would require automatic authentication which would again require details of licensing. So in my best knowledge, analyzing availability of software licensing is a must and foremost step for a feasibility study.
a. Lack of direction
b. Lack of coordination
c. Lack of delegation
d. Lack of control
Answer:
b. Lack of coordination
Explanation:
LAteral communication in human resources and organizational communication is known as the communication that exists between peers and colleagues, so that wouldn cause a lack of cirection, delegation or control because its not between bosses and employees, what it would cause would be a lack of coordination between the employees.
Answer:
b
Explanation:
b, lack of coordination
B. Artificial General Intelligence (AGI)
The term that is described in the question is A. Artificial Narrow Intelligence.
Artificial intelligence simply means the ability of a computer system to automatically make decisions based on the input value received.
Artificial Narrow Intelligence is the computer's ability to do a single task well. It's used in today’s email spam filters, speech recognition, and other specific applications.
Read related link on:
Answer:
A. Artificial Narrow Intelligence.
Explanation:
Artificial intelligence is the ability of a computer system, with the help of programming, automatically make decisions as humanly as possible, based on the input value received. There are three types of artificial intelligence, namely, artificial narrow intelligence (ANI), artificial general intelligence (AGI) and artificial super intelligence (ASI).
ANI is focus on executing one specific task extremely well like web crawler, speech recognition, email spam filters etc. AGI is meant to handle human intellectual task, while ASI performs task beyond human intellect.
Answer:
the word processing
Explanation:
the word is a good word
Answer:
This program is written in C++
Comment are used to explain difficult lines
The first program that prints 0 to 20 (in decimal) starts here
#include<iostream>
int main()
{
//Print From 0 to 20
for(int i = 0;i<21;i++)
{
std::cout<<i<<'\n';
}
}
The modified program to print 0 to 20 in hexadecimal starts here
#include<iostream>
using namespace std;
int main()
{
//Declare variables to use in conversion;
int tempvar, i=1,remain;
//Declare a char array of length 50 to hold result
char result[50];
//Print 0
cout<<"0"<<endl;
// Iterate from 1 to 20
for(int digit = 1; digit<21; digit++)
{
//Start Conversion Process
//Initialize tempvar to digit (1 to 20)
tempvar = digit;
while(tempvar!=0)
{
//Divide tempvar by 16 and get remainder
remain = tempvar%16;
if(remain<10)
{
result[i++]=remain + 48;
}
else
{
result[i++] = remain + 55;
}
//Get new value of tempvar by dividing it by 16
tempvar/=16;
}
//Print result
for(int l=i-1;l>0;l--)
{
cout<<result[l];
}
i=1;
cout<<endl;
}
return 0;
}
//The Program Ends Here
See Attachments for program 1 and 2; program 2 is the modified version of 1
Answer:
The c# program for the scenario is given below.
using System;
public class Program2 {
double total = 0;
static void Main() {
Program2 ob = new Program2();
Console.WriteLine("Enter total energy used in kilo watts ");
int p;
p = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter type of customer ");
char t;
t = Convert.ToChar(Console.ReadLine());
ob.bill_calculator(p, t);
Console.WriteLine("Total charge for " + p + " kilo watts electricity for " + t + " customers is " + ob.total);
}
public void bill_calculator(int e, char c)
{
int first=500, second = 800;
double chg_one = 0.12, chg_two=0.15, chg_three = 0.16, chg_four = 0.20;
if(c == 'R')
{
if(e <= 500)
{
total = (e * chg_one);
}
else if(e > 500)
{
total = ( first * chg_one);
total = total + ((e-first) * chg_two);
}
}
if(c == 'B')
{
if(e <= 800)
{
total = (e * chg_three);
}
else if(e > 800)
{
total = ( first * chg_three);
total = total + ((e-second) * chg_four);
}
}
}
}
OUTPUT
Enter total energy used in kilo watts
1111
Enter type of customer
B
Total charge for 1111 kilo watts electricity for B customers is 142.2
Explanation:
The program takes user input for the type of customer and the amount of electric current used by that customer.
The two input values decide the rate at which total charge is calculated.
For residential customers, charges are divided into slabs of 500 or less and more than 500.
Alternatively, for business customers, charges are divided into slabs of 800 or less and more than 800.
User input is taken in main function.
Charges are calculated in the bill_calculator method which takes both user input as parameters.
If else block is used to calculate the charges.
No input validation is implemented as it is not mentioned in the question.
All code is written inside the class. An object is created of the class.
The methods outside main() are called using the object of the class.