Questions
Complete the attached code so that if the user enters the number 22 for the number...

Complete the attached code so that if the user enters the number 22 for the number of items purchased and 10.98 for the price of each, the following results are displayed:

The total bill is $241.56

Hint: It must include cin and variables.
// This program will read the quantity of an item and its price
// Then print the total price.
// The input will come from the keyboard and the output will go to the monitor.

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

int quantity;                                         // number of item purchased

float itemprice;                                   // price of every article

float totalbill;                             // total account

cout << setprecision(2) << fixed << showpoint;

cout << “please, enter number of items purchased” << endl;
// indicate the instruction to record the amount
// indicate the instruction to ask the price
// indicate the instruction to record the price of each item
// indicate the assignment instruction to determine the total account
// indicate the instruction to show the total on the monitor
return 0;
}

In: Computer Science

write c program to generate 6 numbers to simulate rolling of a dice . use while...

write c program to generate 6 numbers to simulate rolling of a dice . use while loop to run 100 and 10000 times. print out how many times it generates 1, 2,3,4,5,6.

In: Computer Science

network security tool- Nmap • Platform and tools used • Design of experiments (attack/defense) • Preliminary...

network security tool- Nmap
• Platform and tools used
• Design of experiments (attack/defense)
• Preliminary tests
• IEEE style report

In: Computer Science

Evaluate possible benefits and drawbacks of using wireless solutions. Propose at least two alternatives for wireless...

Evaluate possible benefits and drawbacks of using wireless solutions. Propose at least two alternatives for wireless communications in the network

In: Computer Science

How is the emergence of the Internet of Things (IoT) impacting business processes for firms? Give...

How is the emergence of the Internet of Things (IoT) impacting business processes for firms? Give specific examples to illustrate your point(s). Please answer in 2-3 paragraphs

In: Computer Science

Consider the following C++ program that makes use of many features that are unique to C++...

Consider the following C++ program that makes use of many features that are unique to C++ and did not
exist in C.


#include <iostream>
#include <string>
#include <cstdint>
#include <vector>
using namespace std;
enum LetterGrade {
A = 4,
B = 3,
C = 2,
D = 1,
F = 0
};
// type T must be castable into a double
template<class T>
double getArrayAverage(vector<T>& vec) {
double sum = 0;
for (const auto& value : vec) {
sum += static_cast<double>(value);
}
const auto avg = sum / vec.size();
return avg;
}
void convertCharToLetterGrade(char& grade) {
switch (grade) {
case 'A': case 'a':
grade = 4;
return;
case 'B': case 'b':
grade = 3;
return;
case 'C': case 'c':
grade = 2;
return;
case 'D': case 'd':
grade = 1;
return;
case 'F': case 'f':
grade = 0;
return;
default:
cout << "Warning... Invalid Character... Recording an F.\n";
return;
}
}
LetterGrade getLetterGradeFromAverage(const double avg) {
if (avg >= 90)
return LetterGrade::A;
else if (avg >= 80)
return LetterGrade::B;
else if (avg >= 70)
return LetterGrade::C;
else if (avg >= 60)
return LetterGrade::D;
else
return LetterGrade::F;
}
int main()
{
string firstName;
cout << "Please enter your first name: ";
cin >> firstName;
string lastName;
cout << "Please enter your last name: ";
cin >> lastName;
int32_t numPrevCourses;
cout << "Enter number of previous courses: ";
cin >> numPrevCourses;
cin.ignore();
vector<LetterGrade> prevGrades(numPrevCourses);
for (int32_t courseIx = 0; courseIx < numPrevCourses; ++courseIx) {
cout << "Enter letter grade for course " << courseIx << ": ";
char letterGrade;
cin.get(letterGrade);
cin.ignore();
convertCharToLetterGrade(letterGrade);
prevGrades.at(courseIx) = static_cast<LetterGrade>(letterGrade);
}
int32_t numExams;
cout << "Enter number of exams this semester: ";
cin >> numExams;
cin.ignore();
vector<int32_t> examGrades(numExams);
for (int32_t examIx = 0; examIx < numExams; ++examIx) {
cout << "Enter grade for exam " << examIx << " as an integer: ";
cin >> examGrades.at(examIx) ;
cin.ignore();
}
const auto fullName = firstName + " " + lastName;
cout << "Grade Report For " << fullName << ":\n";
const auto examAverage = getArrayAverage(examGrades);
cout << "Your exam average is: " << examAverage << "\n";
// get GPA with newest course added:
const auto newLetterGrade = getLetterGradeFromAverage(examAverage);
prevGrades.push_back(newLetterGrade);
const auto gpa = getArrayAverage(prevGrades);
cout << "Your latest GPA is: " << gpa << "\n";
return 0;
}

Your Task: Please rewrite this program in pure C and without any C++ elements. You may use any
compiler that you would like, but your program cannot have any C++ features .

Once you finish writing your program, please write a brief report (no more than a few paragraphs)
describing features in the above program that are in C++ and not in C and the different work-arounds you
had to come up with in order to achieve the same functionality. Please feel free to elaborate on the
aspects of the C program that were difficult to implement.
Please submit your program (as a .c file) as well as your report (any text format will suffice)

In: Computer Science

It’s not easy to come up with a secure password that one can actually remember. One...

It’s not easy
to come up with a secure password that one can actually remember. One of the
methods proposed is to take a line of text and take first letter of each word to form
a password. An extra step is substitute ”o” with 0, ”a” with ”@”, and ”l” with


1. For instance, using ”Come to the meadow on law street” would yield
”Cttm01s”. Write a program that asks the user to enter a phrase and outputs
the password that is generated using these rules.


You can assume that the words in the phrase will be separated by a single space or
a common punctuation sign such as ”.,?!;:” followed by a space.

PYTHON PLEASE! THANK YOU

In: Computer Science

C -Language Create a simple calculator that performs addition, subtraction, multiplication, and division. Your program should...

C -Language Create a simple calculator that performs addition, subtraction, multiplication, and division. Your program should prompt the user for the operation they wish to perform followed by the numbers they wish to operate on. You should have a function for each operation and use branches to determine which function to call.

I need this to make any integers given, into decimal numbers, such as 3 to 3.0, or 2 to 2.0, also, so that I can multiply or add things like 2.5 + 3.0 or 2.5 * 2.5, etc.

Thank you, please see my code below.

-------------------------------------------------------------

MY CODE:*****

#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

//Functions

int add(int a, int b)

{

    return a + b;

}

int sub(int a, int b)

{

    return a - b;

}

int mul(int a, int b)

{

    return a * b;

}

float div(int a, int b)

{

    return a * 1.0 / b;

}

int main()

{

    int result, a, b, choice;

    float res;

    //User prompts

    printf("Math Calculator: What type of operation would you like me to use? (You will choose numbers after selection) : \n1.Addition\n2.Subtraction\n3.Multiply\n4.Divide\n");

    scanf("%d", &choice);

    printf("Enter first number : ");

    scanf("%d", &a);

    printf("Enter second number : ");

    scanf("%d", &b);


    //Cases

    switch (choice) {

    case 1:

        result = add(a, b);

        printf("The answer equals %d", result);

        break;

    case 2:

        result = sub(a, b);

        printf("The answer equals %d", result);

        break;

    case 3:

        result = mul(a, b);

        printf("The answer equals %d", result);

        break;

    case 4:

        res = div(a, b);

        printf("The answer equals %f", res);

        break;

    default:

        printf("You did not select a valid operation from above.");

        break;

    }


    return 0;

}

In: Computer Science

A palindrome prime is a prime number that reads the same forwards or backwards. An example...

A palindrome prime is a prime number that reads the same forwards or backwards. An example of a
palindrome prime is 131. Write a method with the following signature for determining if a given
number is a palindrome prime.
public static boolean isPallyPrime(int nVal)

Note: For this assignment you are not allowed to use the built in Java class Array as part of your solution for any of these questions. Your Method signatures must
be the same as given here.

In: Computer Science

# Compare two Xml_ file in C# and extract the difference between them in other xml_file...

# Compare two Xml_ file in C# and extract the difference between them in other xml_file

Hi!

I have problem about xml_file, I need to compare between two xml_file with deferent values and I must extract the deference in a new xml file in C#, .Net, I need to write program(not Microsoft XmlDiff and Patch tools). If you can help me please!

Thank you!

Original file is the first one!

<root>

<data name="senChangePassword" xml:space="preserve">

<value>Hi</value>

<comment> Jessica</comment>

</data>

<data name="senChangesWereSuccessfullySaved" xml:space="preserve">

<value>save change.</value>

<comment> Jessica</comment>

</data>

<data name="senChangeUserSettings" xml:space="preserve">

<value>change data</value>

<comment> Jessica</comment>

</data>

<data name="senCompareWith" xml:space="preserve">

<value>Compare</value>

<comment>Jessica</comment>

</data>

<data name="senPasswordResetMailText" xml:space="preserve">

<value>Here projectportal.&lt;br/&gt;&lt;br/&gt;[password]&lt;br/&gt;&lt;br/&gt;go to projectportal: [link]&lt;br/&gt;&lt;br/&gt;Thankyou&lt;br/&gt;&lt;/br&gt;[manager]</value>

<comment>09-2019</comment>

</data>

<data name="senCreatedQuestions" xml:space="preserve">

<value>Save</value>

<comment>Jessica</comment>

</data>

</root>

===========================================

The second xlm_file

<?xml version="1.0" encoding="UTF-8" ?>

<root>

<data name="senChangePassword" xml:space="preserve">

<value>Change Password</value>

<comment> Jessica</comment>

</data>

<data name="senChangeUserSettings" xml:space="preserve">

<value>Change data</value>

<comment>Jessica</comment>

</data>

<data name="senCompareWith" xml:space="preserve">

<value>Compare</value>

<comment> Jessica</comment>

</data>

<data name="senPasswordResetMailText" xml:space="preserve">

<value>Here you get a new password for the project portal.&lt;br/&gt;&lt;br/&gt;[password]&lt;br/&gt;&lt;br/&gt;Follow this link to the project portal: [link]&lt;br/&gt;&lt;br/&gt;Sincerely&lt;br/&gt;&lt;/br&gt;[manager]</value>

<comment> 09-2019</comment>

</data>

<data name="senCreatedQuestions" xml:space="preserve">

<value>Created questions</value>

<comment> Jessica</comment>

</data>

</root>

======================================================
 


In: Computer Science

Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton...

Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is :

F=9/5*C+32

F is the Fahrenheit temperature, and C is the Celsius temperature.

The formula for the conversion from Celsius to Newton is

C = 100/33*N

N is the Newton Temperature and C is the Celsius temperature

Your C++ program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places.

INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater than 0.

PLEASE EXPLAIN. USE DOCUMENTATION.

In: Computer Science

Discuss the steps needed to determine the requirements and strategies to install, configure, and manage DNS...

Discuss the steps needed to determine the requirements and strategies to install, configure, and manage DNS servers. Discuss questions or issues which class members might have about how to determine the requirements and strategies to install, configure, and manage DNS servers. Note: This discussion should be completed early in the week as it will assist you with the Week One Individual Assignment, Practice Labs: 70-741 "Networking with Microsoft® Windows Server® 2016."

In: Computer Science

I need this code to be written in Python: Given a dataset, D, which consists of...

I need this code to be written in Python:

Given a dataset, D, which consists of (x,y) pairs, and a list of cluster assignments, C, write a function centroids(D, C) that computes the new (x,y) centroid for each cluster. Your function should return a list of the new cluster centroids, with each centroid represented as a list of x, y:

def centroid(D, C):

In: Computer Science

Paid Programming from cable companies still largely follows the model it has been following for many...

Paid Programming from cable companies still largely follows the model it has been following for many years. How will technology and the public’s appetite for on'demand, streaming-video change the cable tv industry in the coming years?

In: Computer Science

give a PDA for the language {a1a2: where the length of a1 equals the length of...

give a PDA for the language {a1a2: where the length of a1 equals the length of a2, a1 contains an odd amount of 0’s and a2 contains an odd amount of 0′s}

a1, a2 ∈ {0, 1}*

In: Computer Science