This document contains code for multiple C++ programs that demonstrate various concepts. The first section shows code for a time conversion program that converts between military and standard time formats. The second section shows code for a cookie sales tracking program that uses vectors to store cookie names and sales amounts, and includes functions to calculate totals, percentages, and find best/worst sellers. The third section covers various aspects of the C++ string data type, including initialization, input/output, concatenation, comparison operators, and common string methods.
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
The slides from the C++ and OOPS Crash Course conducted for ACM DBIT by Grejo Joby.
Learn the concepts of OOPS and C++ Programming in the shortest time with these notes.
Please fix the following C++ code to compile correctly in Vi.pdfaccess2future1
Please fix the following C++ code to compile correctly in Visual Studio
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
void menu_driven()
{
cout << "Press 1 to display the agesn";
cout << "Press 2 to change the age of Billionairen";
cout << "Press 3 to display the minimum age of all Billionairesn";
cout << "Press 4 to display the average ages of all Billionairesn";
cout << "Press 5 to display the ages sorted in ascending ordern";
cout << "Press 6 to Quitn";
}
void result(int choice)
{
int NUM_BILLIONAIRES = 2600;
int position;
int change_age;
int ages[NUM_BILLIONAIRES] =
{
50,58,73,66,91,49,48,77,66,64,59,80,82,68,37,73,
67,72,77,44,86,59,86,57,38,64,84,82,53,51,52,85,
84,50,64,57,93,75,94,64,82,86,73,71,68,68,76,83,
79,76,77,86,53,73,50,59,80,51,56,30,76,58,51,81,
89,40,79,57,82,66,72,60,83,64,60,91,55,59,55,77,
67,66,56,86,71,40,65,55,71,60,68,72,54,71,74,65,
61,76,63,66,75,81,64,54,82,54,86,64,35,58,69,89,
55,59,66,58,82,71,42,58,67,54,37,42,92,49,44,92,
63,64,66,64,64,58,70,49,82,57,73,56,67,81,54,89,
50,56,70,64,92,63,66,93,84,94,59,77,63,77,72,72,
57,56,98,52,74,93,40,73,37,68,62,61,42,69,54,69,
59,50,43,82,71,54,75,74,79,80,40,71,48,66,74,46,
65,80,56,72,70,40,79,56,69,79,52,89,66,46,77,76,
67,62,69,57,64,31,33,93,54,66,76,53,38,74,65,56,
53,70,73,54,75,64,75,54,78,71,63,88,83,55,90,76,
59,69,57,92,76,64,64,64,91,56,56,60,74,68,65,57,
57,58,71,58,64,72,70,80,59,72,54,41,84,74,46,43,
81,38,57,36,40,74,71,70,57,57,61,64,78,49,84,55,
57,61,63,65,78,49,73,87,64,51,74,60,65,71,65,64,
79,58,53,78,71,64,61,64,46,71,53,70,63,58,77,71,
81,69,51,68,80,67,60,67,69,78,80,93,74,67,93,85,
79,64,68,66,37,52,53,78,53,71,83,80,64,55,72,86,
71,55,67,82,64,89,77,61,80,87,88,68,52,48,91,67,
61,90,79,84,62,59,39,58,58,39,52,60,73,79,73,55,
60,51,65,78,54,62,55,36,52,34,61,60,40,75,52,76,
67,60,51,76,57,60,69,57,33,58,58,57,77,53,59,84,
95,72,45,58,77,31,55,57,67,59,70,74,60,64,61,80,
58,72,67,92,28,53,57,61,86,57,53,71,64,65,69,57,
58,70,58,50,73,82,70,50,84,70,80,76,74,75,88,84,
65,70,60,54,70,59,64,77,83,50,58,70,80,76,58,63,
84,78,64,49,60,65,62,64,80,45,87,46,66,78,95,80,
71,46,79,85,53,58,77,63,57,38,71,66,54,71,80,81,
87,90,44,76,77,56,48,59,65,51,64,61,92,67,60,54,
53,80,77,62,79,64,52,74,55,81,67,91,89,58,54,57,
79,76,78,69,64,73,55,64,73,71,72,47,48,66,75,63,
60,61,50,78,68,41,71,44,83,54,72,64,87,57,49,50,
58,55,64,42,81,76,63,54,65,54,62,59,59,66,64,53,
82,89,59,85,57,41,59,64,87,70,71,80,65,62,69,63,
82,68,90,54,51,55,66,79,71,56,77,63,61,49,67,69,
66,77,80,56,97,68,73,66,60,64,67,59,57,78,60,48,
79,55,60,96,59,70,80,68,62,28,56,58,64,67,82,80,
57,58,89,56,70,35,75,52,67,50,49,88,63,62,69,57,
70,65,93,49,81,80,64,61,81,77,61,40,61,77,55,64,
78,84,75,95,76,67,55,64,81,86,70,60,85,66,39,62,
81,63,66,74,54,63,56,67,94,51,82,63,52,57,89,91,
64,67,67,72,76,51,53,68,54,76,68,87,66,44,78,71,
92,40,81,80,42,58,53,88,78,61,69,66,72,59,72,72,
68,42,57,74,64,66,82,40,40,71,56,82,79,64,40,66,
59,67,64,54,8.
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
The slides from the C++ and OOPS Crash Course conducted for ACM DBIT by Grejo Joby.
Learn the concepts of OOPS and C++ Programming in the shortest time with these notes.
Please fix the following C++ code to compile correctly in Vi.pdfaccess2future1
Please fix the following C++ code to compile correctly in Visual Studio
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
void menu_driven()
{
cout << "Press 1 to display the agesn";
cout << "Press 2 to change the age of Billionairen";
cout << "Press 3 to display the minimum age of all Billionairesn";
cout << "Press 4 to display the average ages of all Billionairesn";
cout << "Press 5 to display the ages sorted in ascending ordern";
cout << "Press 6 to Quitn";
}
void result(int choice)
{
int NUM_BILLIONAIRES = 2600;
int position;
int change_age;
int ages[NUM_BILLIONAIRES] =
{
50,58,73,66,91,49,48,77,66,64,59,80,82,68,37,73,
67,72,77,44,86,59,86,57,38,64,84,82,53,51,52,85,
84,50,64,57,93,75,94,64,82,86,73,71,68,68,76,83,
79,76,77,86,53,73,50,59,80,51,56,30,76,58,51,81,
89,40,79,57,82,66,72,60,83,64,60,91,55,59,55,77,
67,66,56,86,71,40,65,55,71,60,68,72,54,71,74,65,
61,76,63,66,75,81,64,54,82,54,86,64,35,58,69,89,
55,59,66,58,82,71,42,58,67,54,37,42,92,49,44,92,
63,64,66,64,64,58,70,49,82,57,73,56,67,81,54,89,
50,56,70,64,92,63,66,93,84,94,59,77,63,77,72,72,
57,56,98,52,74,93,40,73,37,68,62,61,42,69,54,69,
59,50,43,82,71,54,75,74,79,80,40,71,48,66,74,46,
65,80,56,72,70,40,79,56,69,79,52,89,66,46,77,76,
67,62,69,57,64,31,33,93,54,66,76,53,38,74,65,56,
53,70,73,54,75,64,75,54,78,71,63,88,83,55,90,76,
59,69,57,92,76,64,64,64,91,56,56,60,74,68,65,57,
57,58,71,58,64,72,70,80,59,72,54,41,84,74,46,43,
81,38,57,36,40,74,71,70,57,57,61,64,78,49,84,55,
57,61,63,65,78,49,73,87,64,51,74,60,65,71,65,64,
79,58,53,78,71,64,61,64,46,71,53,70,63,58,77,71,
81,69,51,68,80,67,60,67,69,78,80,93,74,67,93,85,
79,64,68,66,37,52,53,78,53,71,83,80,64,55,72,86,
71,55,67,82,64,89,77,61,80,87,88,68,52,48,91,67,
61,90,79,84,62,59,39,58,58,39,52,60,73,79,73,55,
60,51,65,78,54,62,55,36,52,34,61,60,40,75,52,76,
67,60,51,76,57,60,69,57,33,58,58,57,77,53,59,84,
95,72,45,58,77,31,55,57,67,59,70,74,60,64,61,80,
58,72,67,92,28,53,57,61,86,57,53,71,64,65,69,57,
58,70,58,50,73,82,70,50,84,70,80,76,74,75,88,84,
65,70,60,54,70,59,64,77,83,50,58,70,80,76,58,63,
84,78,64,49,60,65,62,64,80,45,87,46,66,78,95,80,
71,46,79,85,53,58,77,63,57,38,71,66,54,71,80,81,
87,90,44,76,77,56,48,59,65,51,64,61,92,67,60,54,
53,80,77,62,79,64,52,74,55,81,67,91,89,58,54,57,
79,76,78,69,64,73,55,64,73,71,72,47,48,66,75,63,
60,61,50,78,68,41,71,44,83,54,72,64,87,57,49,50,
58,55,64,42,81,76,63,54,65,54,62,59,59,66,64,53,
82,89,59,85,57,41,59,64,87,70,71,80,65,62,69,63,
82,68,90,54,51,55,66,79,71,56,77,63,61,49,67,69,
66,77,80,56,97,68,73,66,60,64,67,59,57,78,60,48,
79,55,60,96,59,70,80,68,62,28,56,58,64,67,82,80,
57,58,89,56,70,35,75,52,67,50,49,88,63,62,69,57,
70,65,93,49,81,80,64,61,81,77,61,40,61,77,55,64,
78,84,75,95,76,67,55,64,81,86,70,60,85,66,39,62,
81,63,66,74,54,63,56,67,94,51,82,63,52,57,89,91,
64,67,67,72,76,51,53,68,54,76,68,87,66,44,78,71,
92,40,81,80,42,58,53,88,78,61,69,66,72,59,72,72,
68,42,57,74,64,66,82,40,40,71,56,82,79,64,40,66,
59,67,64,54,8.
Start with the inclusion of libraries#include iostream .docxMARRY7
// Start with the inclusion of libraries
#include <iostream> //The library of io functions
#include <fstream> //The library of external stream functions
#include <cstdlib> //The library for external errors
#include <string> //The library for string functions
#include <cmath> //The library of C math functions
#include <iomanip> //Allows setting widths, etc. for I/O
#include <stdlib.h>
#include <stdio.h>
#include<vector>
using namespace std;
// Define all of the prototypes for functions used in the program
// Counts the number of unique letters seen
int countunique(int *array, int size);
// Creates the input file and formats it for use by the cipher section.
void createinput(string ifile, string ofile);
// Creates the encoded input file
void createcipher(int key, string ifile, string ofile);
// Finds and counts the number of digrams
int digram(int *pointer, string ifile);
// Counts the letter frequency in the encoded input file
int lettercount(int*, string ifile, string ofile);
// Finds the highest count in the singlton (or any other) array
int singleton(int*, int size);
// Trims an input file to the right size starting at an offset
void trimfile(string ifile, string ofile, int offset, int size);
// Begin the main function for testing
int main(int argc, char* argv[])
{
int count = 0;
int second = 0;
int singlefreq[26];
int *single = singlefreq;
int delta;
int loop; //The loop counter for arguments
int final = 0;
int totalcnt;
int key = -1; //Sets the key value
int len = 0; //The length to investigate for testing
int off; //Holds the offset into the file
double m; //Holds the metric error value
char loopletter;
float percent;
string ifile1 = "";
string ofile1 = "";
string deflt = "c:\\dissertation\\ShiftandSubcipherC++files\\clean.txt";
string ifile2 = "";
string ofile2 = ""; //Holds selected file path names
string cmdarg; //Holds the command line argument
string stop = "l"; //Gives the stop condition, assumes l
string reportfile = "c:\\dissertation\\test\\report.txt";
ofstream outs; //Declare an output stream for reporting
int digramc[676]; //Set up the digram array
int *two = digramc; //Point to the digram array
int dicount = 0; //Holds the count of the number of digrams
int total = 0; //Counts the total number of letters seen for analysis
for (loop = 1; loop<argc; loop++) //Decide if we have arguments or must use defaults
{
if (!argv[1])
{
// cout << "No argument found.\n";
ifile1 = deflt;
}
else
{
cmdarg = argv[loop];
if (cmdarg == "-k")
{
loop++;
key = atoi(argv[loop]);
cout << "key = " << key << endl;
}
if (cmdarg == "-l")
{
loop++;
len = atoi(argv[loop]);
cout << "Run for " << len << " characters.\n";
}
if (cmdarg == "-m")
{
loop++;
m = atof(argv[loop]);
cout << "Run until and error of " << m << "\n";
}
if (cmdarg == "-off")
{
loop++;
off = atoi(argv[loop]);
cout << ...
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
I have written the code but cannot complete the assignment please help me to complete.
Please don't just copy other s answers as your own.
// Insertion sort
/*
#include <ctime>
#include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
// Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current
position
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
insertionSort(arr, num);
end = clock();
cout << "Sorted array: \n";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
timetaken = ((double) (end - start)) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// Shell Sort
/*
#include <ctime>
#include <iostream>
using namespace std;
int shellSort(int arr[], int n) {
for (int gap = n/2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i += 1) {
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
return 0;
}
void printArray(int arr[], int n) {
for (int i=0; i<n; i++)
cout << arr[i] << " ";
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
shellSort(arr, num);
end = clock();
cout << "\nArray after sorting: \n";
printArray(arr, n);
cout << endl;
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// MergeSort
/*
#include <ctime>
#include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1 + j];
i = 0;
j = 0;
k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r) {
if (l < r) {
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
merge(arr, l, m, r);
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int arr_size = sizeof(arr) / sizeof(arr[0]);
clock_t start;
clock_t end;
double timetaken;
start = clock();
mergeSort(arr, 0, arr_size - 1);
end = clock();
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
.
C++ very good for us jvkbivucyyfuvivucyxtcubobicyxyvinoucyvibivuvuvuviviibivufucuvubibibuvibibbbibibibhibobkvucycuvibibibibobobobobobobobobobibobkgxyvibibihobibibibibibibibibibibibibibibibivibivuvuvuvuvuvbobobohobkbkbobkkbcccvgvgvgctctctctcrctcrcrcrcrcrvtvtvtctcrcrcrcrcrcrcrcrcrcrcrcrcrcrctvfvfcfvfvtcrcrct rvtctvtvtcrcrcrcrcrcrcrcrcrcrcrcrctctcrcrcrcrcrcrcrcrcrcrcrcrvrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrctvtvtvtvtvtvtctvbvvgghhhbbbbbhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhuhhuuuhuuuuuuhuuuuuuuuuuuujtvtvfvtvtvtvtvfvtctvtcctcfctcrcfcfcf f f cccccccccfccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
I am Baddie K. I am a C++ Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Queensland. I have been helping students with their homework for the past 9 years. I solve homework related to C++. Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Homework.
PART B Please response to these two original posts below. Wh.docxsmile790243
PART B
Please response to these two original posts below. When
responding to these posts, please either expand the
thought, add additional insights, or respectfully disagree
and explain why. Remember that we are after reasons
and arguments, and not simply the statement of
opinions.
Original Post 1
Are human lives intrinsically valuable? If so, in virtue of what? (Is
it our uniqueness, perhaps, or our autonomy, or something else?)
To begin, I would like to remind us that being intrinsically valuable
means having values for just being us and nothing else. I believe
that human lives are intrinsically valuable in virtue of our
uniqueness. As a bio nerd, I would like to state the fact that there
are a lot of crossover events during meiosis, which create trillions
of different DNA combinations. Hence, from a biological
standpoint, without considering other aspects, being you is
already valuable because you are that one sperm that won the
race and got fertilized. On a larger scale, there are hardly two
people whose look and behaviors are the same in the same
family, unless they are identical twins. However, identical twins
still act differently and have differences (such as fingerprints).
Since we are raised in different families, we are taught different
things and have different cultures. In general, we all have
different genetic information, appearances, personalities, senses
of humor, ambitions, talents, interests and life experiences. These
characteristics make up our “unique individual value” and make
us so unique and irreplaceable.
I would also love to discuss how our diversities enrich and
contribute to society, but that would be a talk about our extrinsic
values.
Original Post 2
Are human lives intrinsically valuable? If so, in virtue of what? (Is
it our uniqueness, perhaps, or our autonomy, or something else?)
I believe that human lives are intrinsically valuable due to a
number of reasons. Firstly, human lives aren’t replaceable. You
can’t replace a human being with another just like you can
replace a broken laptop with brand new one. Part of the reason
why we tend to think this way is that we were nurtured with the
notion that there is, indeed, a special value to human life. This
could be in virtue of our uniqueness-- the fact that we are
sentient and capable of complex thoughts and emotions
separates us from any other species on this planet. From a
scientific standpoint, this is also one of the reasons as to why
humans became the dominant species in today’s age.
Moreover, human lives aren’t disposable. I think this is largely due
to us humans having the ability to empathize with others. We
understand that it’s morally inappropriate to take the life of
another individual even if they’re complete strangers because
they’re another human being like us who has their own thoughts,
values, memories, and stories. In a way, we have a strong
emotional connection to our own species. As .
Part C Developing Your Design SolutionThe Production Cycle.docxsmile790243
Part C Developing Your Design
Solution
The Production Cycle
Within the four stages of the design workflow there are two distinct parts.
The first three stages, as presented in Part B of this book, were described
as ‘The Hidden Thinking’ stages, as they are concerned with undertaking
the crucial behind-the-scenes preparatory work. You may have completed
them in terms of working through the book’s contents, but in visualisation
projects they will continue to command your attention, even if that is
reduced to a background concern.
You have now reached the second distinct part of the workflow which
involves developing your design solution. This stage follows a production
cycle, commencing with rationalising design ideas and moving through to
the development of a final solution.
The term cycle is appropriate to describe this stage as there are many loops
of iteration as you evolve rapidly between conceptual, practical and
technical thinking. The inevitability of this iterative cycle is, in large part,
again due to the nature of this pursuit being more about optimisation rather
than an expectation of achieving that elusive notion of perfection. Trade-
offs, compromises, and restrictions are omnipresent as you juggle ambition
and necessary pragmatism.
How you undertake this stage will differ considerably depending on the
nature of your task. The creation of a relatively simple, single chart to be
slotted into a report probably will not require the same rigour of a formal
production cycle that the development of a vast interactive visualisation to
be used by the public would demand. This is merely an outline of the most
you will need to do – you should edit, adapt and participate the steps to fit
with your context.
There are several discrete steps involved in this production cycle:
Conceiving ideas across the five layers of visualisation design.
Wireframing and storyboarding designs.
Developing prototypes or mock-up versions.
219
Testing.
Refining and completing.
Launching the solution.
Naturally, the specific approach for developing your design solution (from
prototyping through to launching) will vary hugely, depending particularly
on your skills and resources: it might be an Excel chart, or a Tableau
dashboard, an infographic created using Adobe Illustrator, or a web-based
interactive built with the D3.js library. As I have explained in the book’s
introduction, I’m not going to attempt to cover the myriad ways of
implementing a solution; that would be impossible to achieve as each task
and tool would require different instructions.
For the scope of this book, I am focusing on taking you through the first
two steps of this cycle – conceiving ideas and wireframing/storyboarding.
There are parallels here with the distinctions between architecture (design)
and engineering (execution) – I’m effectively chaperoning you through to
the conclusion of your design thinking.
To fulfil this, Part C presents a detailed breakdown of the many design
.
More Related Content
Similar to Lab Assignment #6, part 3 Time ConversionProgram Name lab.docx
Start with the inclusion of libraries#include iostream .docxMARRY7
// Start with the inclusion of libraries
#include <iostream> //The library of io functions
#include <fstream> //The library of external stream functions
#include <cstdlib> //The library for external errors
#include <string> //The library for string functions
#include <cmath> //The library of C math functions
#include <iomanip> //Allows setting widths, etc. for I/O
#include <stdlib.h>
#include <stdio.h>
#include<vector>
using namespace std;
// Define all of the prototypes for functions used in the program
// Counts the number of unique letters seen
int countunique(int *array, int size);
// Creates the input file and formats it for use by the cipher section.
void createinput(string ifile, string ofile);
// Creates the encoded input file
void createcipher(int key, string ifile, string ofile);
// Finds and counts the number of digrams
int digram(int *pointer, string ifile);
// Counts the letter frequency in the encoded input file
int lettercount(int*, string ifile, string ofile);
// Finds the highest count in the singlton (or any other) array
int singleton(int*, int size);
// Trims an input file to the right size starting at an offset
void trimfile(string ifile, string ofile, int offset, int size);
// Begin the main function for testing
int main(int argc, char* argv[])
{
int count = 0;
int second = 0;
int singlefreq[26];
int *single = singlefreq;
int delta;
int loop; //The loop counter for arguments
int final = 0;
int totalcnt;
int key = -1; //Sets the key value
int len = 0; //The length to investigate for testing
int off; //Holds the offset into the file
double m; //Holds the metric error value
char loopletter;
float percent;
string ifile1 = "";
string ofile1 = "";
string deflt = "c:\\dissertation\\ShiftandSubcipherC++files\\clean.txt";
string ifile2 = "";
string ofile2 = ""; //Holds selected file path names
string cmdarg; //Holds the command line argument
string stop = "l"; //Gives the stop condition, assumes l
string reportfile = "c:\\dissertation\\test\\report.txt";
ofstream outs; //Declare an output stream for reporting
int digramc[676]; //Set up the digram array
int *two = digramc; //Point to the digram array
int dicount = 0; //Holds the count of the number of digrams
int total = 0; //Counts the total number of letters seen for analysis
for (loop = 1; loop<argc; loop++) //Decide if we have arguments or must use defaults
{
if (!argv[1])
{
// cout << "No argument found.\n";
ifile1 = deflt;
}
else
{
cmdarg = argv[loop];
if (cmdarg == "-k")
{
loop++;
key = atoi(argv[loop]);
cout << "key = " << key << endl;
}
if (cmdarg == "-l")
{
loop++;
len = atoi(argv[loop]);
cout << "Run for " << len << " characters.\n";
}
if (cmdarg == "-m")
{
loop++;
m = atof(argv[loop]);
cout << "Run until and error of " << m << "\n";
}
if (cmdarg == "-off")
{
loop++;
off = atoi(argv[loop]);
cout << ...
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
I have written the code but cannot complete the assignment please help me to complete.
Please don't just copy other s answers as your own.
// Insertion sort
/*
#include <ctime>
#include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
// Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current
position
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
insertionSort(arr, num);
end = clock();
cout << "Sorted array: \n";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
timetaken = ((double) (end - start)) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// Shell Sort
/*
#include <ctime>
#include <iostream>
using namespace std;
int shellSort(int arr[], int n) {
for (int gap = n/2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i += 1) {
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
return 0;
}
void printArray(int arr[], int n) {
for (int i=0; i<n; i++)
cout << arr[i] << " ";
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
shellSort(arr, num);
end = clock();
cout << "\nArray after sorting: \n";
printArray(arr, n);
cout << endl;
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// MergeSort
/*
#include <ctime>
#include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1 + j];
i = 0;
j = 0;
k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r) {
if (l < r) {
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
merge(arr, l, m, r);
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int arr_size = sizeof(arr) / sizeof(arr[0]);
clock_t start;
clock_t end;
double timetaken;
start = clock();
mergeSort(arr, 0, arr_size - 1);
end = clock();
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
.
C++ very good for us jvkbivucyyfuvivucyxtcubobicyxyvinoucyvibivuvuvuviviibivufucuvubibibuvibibbbibibibhibobkvucycuvibibibibobobobobobobobobobibobkgxyvibibihobibibibibibibibibibibibibibibibivibivuvuvuvuvuvbobobohobkbkbobkkbcccvgvgvgctctctctcrctcrcrcrcrcrvtvtvtctcrcrcrcrcrcrcrcrcrcrcrcrcrcrctvfvfcfvfvtcrcrct rvtctvtvtcrcrcrcrcrcrcrcrcrcrcrcrctctcrcrcrcrcrcrcrcrcrcrcrcrvrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrcrctvtvtvtvtvtvtctvbvvgghhhbbbbbhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhuhhuuuhuuuuuuhuuuuuuuuuuuujtvtvfvtvtvtvtvfvtctvtcctcfctcrcfcfcf f f cccccccccfccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
I am Baddie K. I am a C++ Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Queensland. I have been helping students with their homework for the past 9 years. I solve homework related to C++. Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Homework.
PART B Please response to these two original posts below. Wh.docxsmile790243
PART B
Please response to these two original posts below. When
responding to these posts, please either expand the
thought, add additional insights, or respectfully disagree
and explain why. Remember that we are after reasons
and arguments, and not simply the statement of
opinions.
Original Post 1
Are human lives intrinsically valuable? If so, in virtue of what? (Is
it our uniqueness, perhaps, or our autonomy, or something else?)
To begin, I would like to remind us that being intrinsically valuable
means having values for just being us and nothing else. I believe
that human lives are intrinsically valuable in virtue of our
uniqueness. As a bio nerd, I would like to state the fact that there
are a lot of crossover events during meiosis, which create trillions
of different DNA combinations. Hence, from a biological
standpoint, without considering other aspects, being you is
already valuable because you are that one sperm that won the
race and got fertilized. On a larger scale, there are hardly two
people whose look and behaviors are the same in the same
family, unless they are identical twins. However, identical twins
still act differently and have differences (such as fingerprints).
Since we are raised in different families, we are taught different
things and have different cultures. In general, we all have
different genetic information, appearances, personalities, senses
of humor, ambitions, talents, interests and life experiences. These
characteristics make up our “unique individual value” and make
us so unique and irreplaceable.
I would also love to discuss how our diversities enrich and
contribute to society, but that would be a talk about our extrinsic
values.
Original Post 2
Are human lives intrinsically valuable? If so, in virtue of what? (Is
it our uniqueness, perhaps, or our autonomy, or something else?)
I believe that human lives are intrinsically valuable due to a
number of reasons. Firstly, human lives aren’t replaceable. You
can’t replace a human being with another just like you can
replace a broken laptop with brand new one. Part of the reason
why we tend to think this way is that we were nurtured with the
notion that there is, indeed, a special value to human life. This
could be in virtue of our uniqueness-- the fact that we are
sentient and capable of complex thoughts and emotions
separates us from any other species on this planet. From a
scientific standpoint, this is also one of the reasons as to why
humans became the dominant species in today’s age.
Moreover, human lives aren’t disposable. I think this is largely due
to us humans having the ability to empathize with others. We
understand that it’s morally inappropriate to take the life of
another individual even if they’re complete strangers because
they’re another human being like us who has their own thoughts,
values, memories, and stories. In a way, we have a strong
emotional connection to our own species. As .
Part C Developing Your Design SolutionThe Production Cycle.docxsmile790243
Part C Developing Your Design
Solution
The Production Cycle
Within the four stages of the design workflow there are two distinct parts.
The first three stages, as presented in Part B of this book, were described
as ‘The Hidden Thinking’ stages, as they are concerned with undertaking
the crucial behind-the-scenes preparatory work. You may have completed
them in terms of working through the book’s contents, but in visualisation
projects they will continue to command your attention, even if that is
reduced to a background concern.
You have now reached the second distinct part of the workflow which
involves developing your design solution. This stage follows a production
cycle, commencing with rationalising design ideas and moving through to
the development of a final solution.
The term cycle is appropriate to describe this stage as there are many loops
of iteration as you evolve rapidly between conceptual, practical and
technical thinking. The inevitability of this iterative cycle is, in large part,
again due to the nature of this pursuit being more about optimisation rather
than an expectation of achieving that elusive notion of perfection. Trade-
offs, compromises, and restrictions are omnipresent as you juggle ambition
and necessary pragmatism.
How you undertake this stage will differ considerably depending on the
nature of your task. The creation of a relatively simple, single chart to be
slotted into a report probably will not require the same rigour of a formal
production cycle that the development of a vast interactive visualisation to
be used by the public would demand. This is merely an outline of the most
you will need to do – you should edit, adapt and participate the steps to fit
with your context.
There are several discrete steps involved in this production cycle:
Conceiving ideas across the five layers of visualisation design.
Wireframing and storyboarding designs.
Developing prototypes or mock-up versions.
219
Testing.
Refining and completing.
Launching the solution.
Naturally, the specific approach for developing your design solution (from
prototyping through to launching) will vary hugely, depending particularly
on your skills and resources: it might be an Excel chart, or a Tableau
dashboard, an infographic created using Adobe Illustrator, or a web-based
interactive built with the D3.js library. As I have explained in the book’s
introduction, I’m not going to attempt to cover the myriad ways of
implementing a solution; that would be impossible to achieve as each task
and tool would require different instructions.
For the scope of this book, I am focusing on taking you through the first
two steps of this cycle – conceiving ideas and wireframing/storyboarding.
There are parallels here with the distinctions between architecture (design)
and engineering (execution) – I’m effectively chaperoning you through to
the conclusion of your design thinking.
To fulfil this, Part C presents a detailed breakdown of the many design
.
PART A You will create a media piece based around the theme of a.docxsmile790243
PART A:
You will create a media piece based around the theme of “alternative facts.
Fake News:
Create a
series of 3
short, “fake news” articles or news videos. They should follow a specific theme. Make sure to have a clear understanding of WHY your fake news is being created (fake news is used by people, groups, companies, etc to convince an unsuspecting audience of something. It’s supposed to seem real, but the motivation behind it is to deceive. As part of this option, consider what your motivations are for your deception).
Part A: should be around 750 words for written tasks (or 250 for each 3 part task)
PART B:
The focus for this assignment is to demonstrate a
clear understanding of media conventions
, as well as
purpose
and
audience
. Therefore, along with your media product, you’ll also be required to submit a short
reflection
detailing why you created your product and for whom it was intended. You must discuss and analyze the elements within your media product (including why & how you used the persuasive techniques of ethos, logos and pathos) as well as the other elements of media you used and why.
.
Part 4. Implications to Nursing Practice & Implication to Patien.docxsmile790243
Part 4. Implications to Nursing Practice & Implication to Patient Outcomes
Provide a paragraph summary addressing the topics implications to nursing practice and patient outcomes. This section is NOT another review of the literature or introduction of new topics related to the PICOT question.
You may find if helpful to begin each topic with -
Nurses need to know …
Important patient outcomes include …
Example
– please note this is an older previous students work and so some references are older than 5 years.
Be sure to provide the PICOT question to begin this post.
PICOT Question:
P=Patient Population
I=Intervention
C=Comparison
O=Outcome
T=Time (duration):
In patients in the hospital, (P)
how does frequently provided patient hand washing (I)
compared with patient initiated hand washing (C)
affect hospital acquired infection (O)
within the hospital stay (T)
Implications to Nursing Practice & Patient Outcomes
Nurses need to know that they play a significant role in the reduction of hospital acquired infection by ensuring by health care workers and patients wash hands since nurses have the most interactions with patients. Implementing hand hygiene protocol with patients can enhance awareness and decrease healthcare associated infection (HAI). Both nurses and patients need to know that HAI is associated with increased morbidity and mortality as well cost of treatment and length of hospital stay. Nurses and patients also need to know that most HAI is preventable. Gujral (2015) notes that proper hand hygiene is the single most important, simplest, and least expensive means of reducing prevalence of HAI and the spread of antimicrobial resistance. Nurse and patient hand washing plays a vital role in decreasing healthcare costs and infections in all settings.
References
Gujral, H. (2015.) Survey shows importance of hand washing for infection prevention. American Nurse Today, 10 (10), 20. Retrieved from hEp://www.nursingworld.org/AmericanNurseToday
.
PART AHepatitis C is a chronic liver infection that can be e.docxsmile790243
PART A
Hepatitis C is a chronic liver infection that can be either silent (with no noticeable symptoms) or debilitating. Either way, 80% of infected persons experience continuing liver destruction. Chronic hepatitis C infection is the leading cause of liver transplants in the United States. The virus that causes it is blood borne, and therefore patients who undergo frequent procedures involving transfer of blood are particularly susceptible to infection. Kidney dialysis patients belong to this group. In 2008, a for-profit hemodialysis facility in New York was shut down after nine of its patients were confirmed as having become infected with hepatitis C while undergoing hemodialysis treatments there between 2001 and 2008.
When the investigation was conducted in 2008, investigators found that 20 of the facility’s 162 patients had been documented with hepatitis C infection at the time they began their association with the clinic. All the current patients were then offered hepatitis C testing, to determine how many had acquired hepatitis C during the time they were receiving treatment at the clinic. They were considered positive if enzyme-linked immunosorbent assay (ELISA) tests showed the presence of antibodies to the hepatitis C virus.
Health officials did not test the workers at the hemodialysis facility for hepatitis C because they did not view them as likely sources of the nine new infections. Why not?
Why do you think patients were tested for antibody to the virus instead of for the presence of the virus itself?
Ref.: Cowan, M. K. (2014) (4th Ed.). Microbiology: A Systems Approach, McGraw Hill
PART B
Summary:
Directions for the students: There are 4 essay questions. Please be sure to complete all of them with thorough substantive responses. Current APA Citations are required for all responses.
1. Precisely what is microbial death?
2. Why does a population of microbes not die instantaneously when exposed to an antimicrobial agent?
3. Explain what is wrong with this statement: “Prior to vaccination, the patient’s skin was sterilized with alcohol.” What would be a more correct wording?
4. Conduct additional research on the use of triclosan and other chemical agents in antimicrobial products today. Develop an opinion on whether this process should continue, providing evidence and citations to support your stance.
.
Part A post your answer to the following question1. How m.docxsmile790243
Part A post
your answer to the following question:
1. How might potential reactions to an adolescent’s questioning of their sexual identity, or gender role, impact their social environment, behavior and self-esteem?
2. As social workers, what role can we play in assuring the best outcomes for these adolescents?
Please use the Learning Resources to support your answer.
Part B
post
your answer to the following question:
1. How can social workers work toward assuring the best outcomes for adolescents questioning their sexual orientation or gender identity.
Please use the Learning Resources to support your answer.
.
PART BPlease response to these two original posts below..docxsmile790243
PART B
Please response to these two original posts below. When responding to
these posts, please either expand the thought, add additional insights, or
respectfully disagree and explain why. Remember that we are after reasons
and arguments, and not simply the statement of opinions.
Original Post 1
"What is moral relativism? Why might people be attracted to it? Is
it plausible?"
First of all, moral relativism is the view that moral truths are
subjective and depend on each individual's standpoints. Based
on this, everyone's moral view is legitimate. This can be attracted
because it sounds liberating and there is no need to argue for a
particular position. Moral relativism seems convincing in some
cases. For example, some people are okay with giving money to
homeless people, thinking that it's good to provide for the people
in need. Some people, on the other hand, claim that they can
work to satisfy their own needs. Moral relativism works well in
these cases because they all seem legitimate. However, there are
cases that moral relativism does not seem reasonable. For
example, child sacrifice in some cultures seems cruel and
uncivilized to most people. Hence, moral relativism is not
absolutely true.
Original Post 2
“Is your death bad for you, specifically, or only (at most) for others? Why
might someone claim that it isn’t bad for you?”
I'd start off by acknowledging what the two ancient philosophers,
Lucretius and Epicurus, outlined about death. They made the
point that death isn't necessarily bad for you since no suffering
takes place and that you yourself don't realize your own death. In
this way, one could make the claim that death isn't intrinsically
bad for you.
Another perspective I wanted to add was the influence of death
(both on you and others around you). Specifically, the event of
death itself may not be bad for you, but the idea of impending
death could impact one's life. Some may live freely, totally care-
free, accepting of death and enjoy life in the moment. Others may
be frightened by the idea of death that they live in constant fear
and hence death causing their mental health to take its toll. In
this way, I'd argue that death could, in fact, be bad for you. One
common reason for being afraid of death is the fear of being
forgotten. Not to mention the death of an individual certainly
affects others; death doesn't affect one's life but also all that is
connected to it. Focusing back to the point, it's clear that the
very idea of death directly affects the concerned individual. The
fact that those who live in fear of death are looking for legacies
and footprints to leave after they leave this world is telling of how
death could be arguably bad for you before it even happens.
PART A
Pick one or more questions below and write a substantive post
with >100 words. Please try to provide evidence(s) to support
your idea(s).
Questions:
• Do we have a duty to work out whe.
Part A (50 Points)Various men and women throughout history .docxsmile790243
Part A (50 Points):
Various men and women throughout history have made important contributions to the development of statistical science. Select any one (1) individual from the list below and write a 2 page summary of their influence on statistics. Be specific in detail to explain the concepts they developed and how this advanced our understanding and application of statistics.
Florence Nightingale
Francis Galton
Thomas Bayes
Part B (50 Points):
Select any one statistical concept you learned in this course and explain how it can be applied to our understanding of the Covid-19 pandemic (2 pages). You should use a specific example and include at least one diagram to illustrate your answer.
Please note: Your work must be original and not copied directly from other sources. No citations are needed. Be sure to submit this assignment in Blackboard on the due date specified.
.
Part A:
1. K
2. D
3. N
4. C
5. A
6. O
7. F
8. Q
9. H
10. M
11. S
12. Y
13. I
14. U
15. X
Part B:
1.
A. UTI is short form for Urinary tract infection. Means infection which affects organs of urinary tract. Such as urethra, urinary bladder and kidney. This are main organ for formation of urine and helps to expel it out of body.
B. Kidneys, urethra and urinary bladder gets affected during Urinary tract infection. Generally infection begins with urethra then travels to kidney.
When only lower part gets affected which is called lower UTI also cystitis because involves bladder
And when infection spread to upper side involving kidneys known as pyelonephritis.
2.
A. Microorganism in UTI
Escherichia coli
Klebsiella pneumoniae
B. Coli bacteria lives in intestine. So they also seen near anal canal. From which gets transferred to urethra.
C. Bacteria enters urinary tract from urethra. In very less cases kidney gets infected by blood stream.
3.
Signs and symptoms:
A) Pain with urination:
The infection cause inflammation of urinary tract, the urine from the inflammed urinary tract cause pain in urination.
B) orange or red colour urine:
The inflammation of urinary tract may cause a orange or red colour urine. It is common sign in UTI due to inflammation of urinary tract.
4.
UTI:
Urinary tract infection (UTI) any infection on the urinary tract causing difficult in urination. It most commonly affects the woman because thet are more prone to it.
Diagnosis And treatment:
A) The diagnostic test for UTI:
The two major diagnostic test for UTI are:
Urinalysis:
Urine is collected from the patient who came for test. This test shows the bacterial or any infectious organism in the urine.
The collected urine sample is added to the substance which promotes the growth of the organism in the urine.
If the growth is organism doesn't takes place then the test is negative.
If the organism growth in the urine takes place then the test is positive.
Ultra sound:
The sound waves from the transducer of ultra produce a imaging of the internal organs.
Patient lower abdomen is scanned by ultra sound to detect any abnormality in the organs and structures of urinary tract.
B) The medications for UTI are antibiotics or antimicrobial.
The two drugs are amoxicillin, sulfasulfamethaxazole.
Both of these drugs act on UTI by fighting against the microorganisms in the UTI. By assisting the immune system, it fight against the microorganisms and that relieves the symptoms of UTI.
5.
answer. a) In women at the time of pregnancy the drainage system from the kidney towards bladder become wide, hence, urine does not pass out as quickly. This makes it easier to get an infection. Similarly women has shorter urethra than a man have, the shorter distance make the way easy to bacteria to travel into the bladder.
b) There are no of ways by which women can reduce the risk of getting UTI. Like women should drink plenty of water this will help of getting rid from UTI, a women should protect their urethra .
Part A Develop an original age-appropriate activity for your .docxsmile790243
Part A:
Develop an original age-appropriate activity for your preschool class using
one
of the following.
Froebel’s cube gift
Froebel’s parquetry gift
Lincoln Logs
Describe the activity that you have developed.
Identify at least two (2) skills that the activity would help develop.
Part B:
Develop an original age-appropriate activity for your preschool class promoting the same skill(s) as the activity above, but develop the activity based on the Montessori method.
Describe the activity that you have developed.
What are at least two key differences between the two activities you developed?
.
Part 3 Social Situations2. Identify multicultural challenges th.docxsmile790243
Part 3: Social Situations
2. Identify multicultural challenges that your chosen individual may face as a recent
refugee.
• What are some of the issues that can arise for someone who has recently
immigrated to a new country?
• Explain how these multicultural challenges could impact your chosen individual’s
four areas of development?
3. Suggest plans of action or resources that you feel should be provided to this family to
assist them in proper develop
Part 3: Social Situations
• Proposal paper which identifies multicultural challenges that your chosen individual may face as a recent refugee.
• Suggested plan of action and/or resources which should be implemented to address the multicultural challenges.
• 2-3 Pages in length
• APA Formatting
• Submission will be checked for plagiaris
.
Part A (1000 words) Annotated Bibliography - Create an annota.docxsmile790243
Part A
(1000 words): Annotated Bibliography - Create an annotated bibliography that focuses on ONE particular aspect of current Software Engineering that face a world with different cultural standards. At least seven (7) peer-reviewed articles must be used for this exercise.
Part B
(3000 words):
Research Report
- Write a report of the analysis and synthesis using the
(Part A
) foundational
Annotated Bibliography
.
Part C (500 words): Why is it important to try to minimize complexity in a software system.
Part D (500 words): What are the advantages and disadvantages to companies that are developing software products that use cloud servers to support their development process?
Part E (500 words): Explain why each microservice should maintain its own data. Explain how data in service replicas can be kept consistent?
.
Part 6 Disseminating Results Create a 5-minute, 5- to 6-sli.docxsmile790243
Part 6: Disseminating Results
Create a 5-minute, 5- to 6-slide narrated PowerPoint presentation of your Evidence-Based Project:
· Be sure to incorporate any feedback or changes from your presentation submission in Module 5.
· Explain how you would disseminate the results of your project to an audience. Provide a rationale for why you selected this dissemination strategy.
Points Range: 81 (81%) - 90 (90%)
The narrated presentation accurately and completely summarizes the evidence-based project. The narrated presentation is professional in nature and thoroughly addresses all components of the evidence-based project.
The narrated presentation accurately and clearly explains in detail how to disseminate the results of the project to an audience, citing specific and relevant examples.
The narrated presentation accurately and clearly provides a justification that details the selection of this dissemination strategy that is fully supported by specific and relevant examples.
The narrated presentation provides a complete, detailed, and specific synthesis of two outside resources related to the dissemination strategy explained. The narrated presentation fully integrates at least two outside resources and two or three course-specific resources that fully support the presentation.
Written Expression and Formatting—Paragraph Development and Organization:
Paragraphs make clear points that support well-developed ideas, flow logically, and demonstrate continuity of ideas. Sentences are carefully focused—neither long and rambling nor short and lacking substance. A clear and comprehensive purpose statement and introduction is provided which delineates all required criteria.
Points Range: 5 (5%) - 5 (5%)
Paragraphs and sentences follow writing standards for flow, continuity, and clarity.
A clear and comprehensive purpose statement, introduction, and conclusion is provided which delineates all required criteria.
Written Expression and Formatting—English Writing Standards:
Correct grammar, mechanics, and proper punctuation.
Points Range: 5 (5%) - 5 (5%)
Uses correct grammar, spelling, and punctuation with no errors.
Evidenced Based Change
Leslie Hill
Walden University
Introduction/PurposeChange is inevitable.Health care organizations need change to improve.There are challenges that need to be addressed(Baraka-Johnson et al. 2019).Challenges should be addressed using evidence-based research.These changes enhance professionalism therefore improving quality of care and quality of life.The purpose of this paper is to identify an existing problem in health care and suggest a change idea that would be effective in addressing the problem. The paper also articulates risks associated with the change process, how to distribute the change information and how to implement change successfully.
Organizational CultureThe Organization is a hospice facilityOffers end of life care for pain and symptom managementThe health care providers cu.
Part 3 Social Situations • Proposal paper which identifies multicul.docxsmile790243
Part 3: Social Situations • Proposal paper which identifies multicultural challenges that your chosen individual may face as a recent refugee. • Suggested plan of action and/or resources which should be implemented to address the multicultural challenges. • 2-3 Pages in length • APA Formatting • Submission will be checked for plagiarism
Part 3: Social Situations 2. Identify multicultural challenges that your chosen individual may face as a recent refugee. • What are some of the issues that can arise for someone who has recently immigrated to a new country? • Explain how these multicultural challenges could impact your chosen individual’s four areas of development? 3. Suggest plans of action or resources that you feel should be provided to this family to assist them in proper development.
.
Part 3 Social Situations 2. Identify multicultural challenges that .docxsmile790243
Part 3: Social Situations 2. Identify multicultural challenges that your chosen individual may face as a recent refugee. • What are some of the issues that can arise for someone who has recently immigrated to a new country? • Explain how these multicultural challenges could impact your chosen individual’s four areas of development? 3. Suggest plans of action or resources that you feel should be provided to this family to assist them in proper development.
Part 3: Social Situations • Proposal paper which identifies multicultural challenges that your chosen individual may face as a recent refugee. • Suggested plan of action and/or resources which should be implemented to address the multicultural challenges. • 2-3 Pages in length • APA Formatting • Submission will be checked for plagiarism
.
Part 2The client is a 32-year-old Hispanic American male who c.docxsmile790243
Part 2
The client is a 32-year-old Hispanic American male who came to the United States when he was in high school with his father. His mother died back in Mexico when he was in school. He presents today to the PMHNPs office for an initial appointment for complaints of depression. The client was referred by his PCP after “routine” medical work-up to rule out an organic basis for his depression. He has no other health issues except for some occasional back pain and “stiff” shoulders which he attributes to his current work as a laborer in a warehouse. the “Montgomery- Asberg Depression Rating Scale (MADRS)” and obtained a score of 51 (indicating severe depression). reports that he always felt like an outsider as he was “teased” a lot for being “black” in high school. States that he had few friends, and basically kept to himself. He also reports a remarkably diminished interest in engaging in usual activities, states that he has gained 15 pounds in the last 2 months. He is also troubled with insomnia which began about 6 months ago, but have been progressively getting worse. He does report poor concentration which he reports is getting in “trouble” at work.
· Decision #1: start Zoloft 25mg orally daily
· Which decision did you select?
· Why did you select this decision? Support your response with evidence and references to the Learning Resources.
· What were you hoping to achieve by making this decision? Support your response with evidence and references to the Learning Resources.
· Explain any difference between what you expected to achieve with Decision #1 and the results of the decision. Why were they different?
· Decision #2: Client returns to clinic in four weeks, reports a 25% decrease in symptoms but concerned over the new onset of erectile dysfunction
*add Augmentin Wellbutrin IR 150mg in the morning
· Why did you select this decision? Support y our response with evidence and references to the Learning Resources.
· What were you hoping to achieve by making this decision? Support your response with evidence and references to the Learning Resources.
· Explain any difference between what you expected to achieve with Decision #2 and the results of the decision. Why were they different?
· Decision #3: Client returns to clinic in four weeks, Client stated that depressive symptoms have decreased even more and his erectile dysfunction has abated
· Client reports that he has been feeling “jittery” and sometimes “nervous”
*change to Wellbutrin XL 150mg daily
· Why did you select this decision? Support your response with evidence and references to the Learning Resources.
· What were you hoping to achieve by making this decision? Support your response with evidence and references to the Learning Resources.
· Explain any difference between what you expected to achieve with Decision #3 and the results of the decision. Why were they different?
Explain how ethical considerations might impact your treatment plan and communication with clients.
Conclusion.
Part 2For this section of the template, focus on gathering deta.docxsmile790243
Part 2:
For this section of the template, focus on gathering details about common, specific learning disabilities. These disabilities fall under the IDEA disability categories you researched for the chart above. Review the textbook and the topic study materials and use them to complete the chart.
Learning Disability Definition Characteristics Common Assessments for Diagnosis Potential Effect on Learning and Other Areas of Life Basic Strategies for Addressing the Disability
Attention Deficit Hyperactivity Disorder (ADHD)
Auditory Processing Disorder (APD)
Dyscalculia
Dysgraphia
Dyslexia
Dysphasia/Aphasia
Dyspraxia
Language Processing Disorder (LPD)
Non-Verbal Learning Disabilities
Visual Perceptual/Visual Motor Deficit
.
Part 2 Observation Summary and Analysis • Summary paper of observat.docxsmile790243
Part 2: Observation Summary and Analysis • Summary paper of observation findings for each area of development and connection to the observed participant. • Comprehensive description of the observed participant. • Analyzed observation experience with course material to determine whetherthe participant is developmentally on track for each area of development. • 4 Pages in length • APA Formatting • Submission will be checked for plagiarism
Part 2: Observation Summary and Analysis 1. Review and implement any comments from your instructor for Part 1: Observation. 2. Describe the participant that you observed. • Share your participant’s first name (can be fictional name if participant wants to remain anonymous), age, physical attributes, and you initial impressions. 3. Analyze your observation findings for each area of development (physical, cognitive, social/emotional, and spiritual/moral). • Explain how your observations support the 3-5 bullets for each area of development that you identified in your Development Observation Guidefrom Part 1: Observation. • Explain whether or not your participant is developmentally on track for each area of development. 4. What stood out the most to you about the observation? 5. Include at least 2 credible sources
.
Part 2 Observation Summary and Analysis 1. Review and implement any.docxsmile790243
Part 2: Observation Summary and Analysis 1. Review and implement any comments from your instructor for Part 1: Observation. 2. Describe the participant that you observed. • Share your participant’s first name (can be fictional name if participant wants to remain anonymous), age, physical attributes, and you initial impressions. 3. Analyze your observation findings for each area of development (physical, cognitive, social/emotional, and spiritual/moral). • Explain how your observations support the 3-5 bullets for each area of development that you identified in your Development Observation Guidefrom Part 1: Observation. • Explain whether or not your participant is developmentally on track for each area of development. 4. What stood out the most to you about the observation? 5. Include at least 2 credible sources
Part 2: Observation Summary and Analysis • Summary paper of observation findings for each area of development and connection to the observed participant. • Comprehensive description of the observed participant. • Analyzed observation experience with course material to determine whetherthe participant is developmentally on track for each area of development. • 4-6 Pages in length • APA Formatting • Submission will be checked for plagiarism
.
Part 2Data collectionfrom your change study initiative,.docxsmile790243
Part 2:
Data collection
from your change study initiative, sample, method, display of the results of the data itself, process, and method of analysis (graphs, charts, frequency counts, descriptive statistics of the data, narrative)
Part 3: Interpretation of the results of the Data
Collection and
Analysis, address likely resistance, and provide recommendations for continuing
the study
or evaluating your change study/initiative.
.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
Lab Assignment #6, part 3 Time ConversionProgram Name lab.docx
1. //Lab Assignment #6, part 3: Time Conversion
//Program Name: lab6Part3
//Purpose of the program: converts time from military format to
civilian format
//Authors: Wei Zhou and Shouwen Wang
//Date: 02/19/2016
#include<iostream>
#include <string>
using namespace std;
// get input time
int enterTime(int totalTime, int& hrVal, int& minVal)
{
cout << "please enter a military time(a value between 0000 and
2359) : ";
cin >> totalTime;
2. while (totalTime > 2359 || totalTime < 0) {
cout << "Error: you entered an invalid time. Try again." <<
endl;
cout << "please enter a military time(a value between 0000 and
2359) : ";
cin >> totalTime;
}
return totalTime;
}
//perform conversion
int ConvHrMin(int totalTime, int& hrVal, int& minVal) {
if (totalTime <= 1200) {
hrVal = totalTime / 100;
minVal = totalTime % 100;
}
else {
5. cout << "Time Converter" << endl;
cout << "--------------" << endl;
finalOutput();
cout << endl;
return 0;
}
//Lab Assignment #7: Vectors
//Program Name: lab7part1
//Purpose of the program: working with vectors
//Authors: Wei Zhou
//Date: 03/03/2016
#include<iostream>
6. #include<iomanip>
#include<vector>
#include<string>
using namespace std;
//enter the number of boxes sold for each type of cookie
void numberSell(vector<string> cookienames, vector<int>
&amount) {
int numberSales;
for (int i = 0; i < cookienames.size(); ++i)
{
cout << "Please enter the total sales for " << cookienames[i] <<
": ";
cin >> numberSales;
while (numberSales < 0) {
7. cout << "Error: total sales cannot be a negative number." <<
endl;
cout << "Please enter the total sales for " << cookienames[i] <<
": ";
cin >> numberSales;
}
amount.push_back(numberSales);
}
cout << endl;
}
//calculate total sales
int totalSales(vector<int> amount) {
int total = 0;
for (int i = 0; i < amount.size(); ++i)
{
total += amount[i];
}
8. return total;
}
//find the lowest selling cookie
string findBest(vector<string> cookienames, vector<int>
amount) {
int highest = amount[0], exponent = 0;
for (int i = 1; i<amount.size(); ++i)
{
if (amount[i] >= highest)
{
highest = amount[i];
exponent = i;
}
}
return cookienames[exponent];
}
//find the highest selling cookie
9. string findWorst(vector<string> cookienames, vector<int>
amount) {
int lowest = amount[0], exponent = 0;
for (int i = 1; i<amount.size(); ++i)
{
if (amount[i] <= lowest)
{
lowest = amount[i];
exponent = i;
}
}
return cookienames[exponent];
}
//calculate percentages of sales
vector<double> findPercentage(vector<int> amount, int total) {
double percentage;
vector<double> line;
10. for (int i = 0; i < amount.size(); ++i)
{
percentage = amount[i] * 100 / total;
line.push_back(percentage);
}
return line;
}
//display report
void finalResult(vector<string> cookienames, vector<int>
amount, int total, vector<double> percentage, string best, string
worst) {
cout << left << setw(30) << "Type of Cookie" << setw(25) <<
"Boxes Sold" << "Percentage" << endl;
cout << "---------------------------------------------------------------"
<< endl;
for (int i = 0; i < cookienames.size(); ++i)
{
11. cout << fixed << setprecision(2);
cout << left << setw(30) << cookienames[i] << setw(25) <<
amount[i] << setw(9) << percentage[i] << "%" << endl;
}
cout << endl;
cout << "Total number of boxes sold this month: " << total <<
endl;
cout << left << setw(45) << "Best seller cookie: " << best <<
endl;
cout << left << setw(45) << "Worst seller cookie: " << worst <<
endl;
cout << endl;
}
int main()
{
cout << "Cookie sales tracking program" << endl;
cout << "-------------------------------" << endl;
14. Enumerated Types
The string Type
The string data type
To hold text data, such as a person's name or e-mail address,
C++ uses the string type.
The string type is kept in its own library:
#include <string>
A string variable is created just like any other variable:
string variableName;
A string variable may be initialized upon declaration in the
usual fashion.
Input and output of strings is just like any other variable type.
Examples
Declaring and initializing a string variable:
string today = "Tuesday"; // initialization
string tomorrow; //an empty string ""
Input and Output:
cout << "I think today is " << today << endl;
cout << "What day do you think it is tomorrow? ";
15. cin >> tomorrow;
cout << "OK, so tomorrow is " << tomorrow << endl;
Reading text with multiple words
To read in text that contains spaces we use the getline():
getline (InputSource, destinationVariable);
getline() command will read in all information until it
encounters an end of line.
Note that using getline() after using >> can cause problems.
We can fix these problems using the method cin.ignore().
Example
cout << "Please enter your age: ";
int age;
cin >> age;
cout << "Please enter your full name: ";
cin.ignore();
string fullName;
getline (cin, fullName);
cout << "Thank you, " << fullName << ". ";
cout << "Your are " << age << “ years old.";
Assignment and concatenation
The = sign is used for assignment, just as with other variables.
That is, the value of the expression on the right of the = is
assigned to the variable on the left.
16. The + operator concatenates two strings
That is, it appends one string to the end of another.
Example
string day = "Tuesday";
cout << "Today is " << day << "." << endl;
string date = "March 8";
cout << "Today is " << date << "." << endl;
date = day + ", " + date;
cout << "Today is " << date << "." << endl;
The segment of code about will output:
Today is Tuesday.
Today is March 8.
Today is Tuesday, March 8.
The index system
A string is a collection of characters.
Each character inside a string has an index indicating its
location inside the string.
The first character in the string has index zero. The last
character has an index one less than the size of the string.
The subscript operator
In order to access a character inside a string we can use the
17. subscript operator [] and a valid index value.
Example:
string course = "CS 143";
char firstLetter = course[0]; //C
char lastChar = course[5]; // 3
Comparing Strings
The relational operators can be used to compare strings.
Example:
string name1 = "Mary";
string name2 = "Mark";
if ( name1 == name2 )
cout << "The names are the same" ;
else if ( name1 < name2 )
cout << "In alphabetical order: "
<< name1 << " " << name2 ;
else
cout << "In alphabetical order: "
<< name2 << " " << name1 ;
11
How does string comparison work?
In memory characters are stored using numeric codes.
The most commonly used code is ASCII: http://asciiset.com/
Each letter (a-z, A-Z), digit (0-9), and other characters have a
code associated with them:
18. ‘A’ – ‘Z’: codes 65 – 90
‘a’ – ‘z’: codes 97 – 122
‘0’ – ‘9’ : codes 48 – 57
When the relational operators compare two strings:
They compare the strings character-by-character
They actually compare the codes for the characters
12
Example
If one of the strings in a comparison is shorter than the other
one, only the corresponding characters are compared.
If the corresponding characters are identical, the shorter string
is consider less than the longer string
Mary > Mark because: y > k
or in other words: 121 > 107
121
107
114
97
77
114
97
77
ASCII Codes
String Methods
The string type comes with a collection of very useful methods.
19. Remember that in order to invoke a method your must use the
dot notation.
Some methods return values and some don’t
Some methods have parameters and some don’t
returnValue = stringObject.methodName(arguments);
length() and size()
Both of these methods return the number of characters in the
string.
The count will include blank space and special characters if the
string contains these.
The type of the returned value is int.
Example
string course = "CS 143";
cout << "The string " << course << " has "
<< course.size()
<< " characters (including blanks). " ;
cout << "That means " << course.length() - 1
<< " letters.";
The at() method
Another way to access the characters in a string is the at(index)
method.
This method takes as its input a valid index value
This method returns the character (char) at the given index
value.
Example:
string course = "CS 143";
char firstLetter = course.at(0); //C
char lastChar = course.at(course.size() -1); // 3
20. The clear() and empty() methods
The clear() method removes all the elements in a string (and
resets its size to zero).
The empty() method returns true if the string is empty, false
otherwise.
Example:
string course = "CS 143";
course.clear(); //now course is an empty string ""
if ( course.empty() )
cout << "There are 0 characters in the string";
push_back()and append() methods
push_back(newChar): appends the char newChar to the end of
the string.
append(secondStr): appends a copy of the string secondString.
Example:
string course = "CS 143";
course.append(" C++"); //course is now: CS 143 C++
course.push_back('!'); //course is now: CS 143 C++!
The replace() method
replace(index, num, subString) replaces num characters starting
at index with a copy of the string subString.
Example:
string course = "CS 143";
course.replace(3, 3, "171"); //course is now: CS 171
21. erase(), insert()and resize() methods
erase(index, n) deletes n characters of the string, starting at
index.
insert(index, subStr) inserts the string subStr starting at index.
resize(newSize) resizes the string to have newSize characters.
If decrease, drops extra characters.
If increase, sets new characters to null ('0', ASCII value 0).
Example:
string course = "CS 143";
course.erase(2, 1); //course is now: CS143
course.insert(2, "---"); //course is now: CS---143
course.resize(2); //course is now: CS
Searching a string
You can use the find() method to search for a substring in a
string.
There are two ways you can use the find() method:
find(item)
find(item, startPoint)
Item: the substring we are looking for
startPoint: an index where to start the search
This method returns the index of the first occurrence if item in
the string (if found). Otherwise it returns -1
Searching a string
The rfind() method works similar to find() except that it starts
the search from the end/back of the string and searches
backwards through the string to the beginning/front.
rfind stands for reverse find.
22. Example: find()
string course = "CS 143";
int location, secondS;
location = course.find("143"); //location = 3
location = course.find("171"); //location = -1
location = course.find("S"); //location = 1
secondS = course.find("S",location + 1); //secondS = -1
Example: rfind()
string course = "CS 143";
int location, secondS;
location = course.rfind("143"); //location = 3
location = course.rfind("171"); //location = -1
location = course.rfind("S"); //location = 1
secondS = course.rfind("S",location - 1);//secondS = -1
Obtaining substrings
The subsrt() method allows you to obtain a substring from a
string.
subsrt(index, howMany);
Index: the index of the first character to obtain
howMany: how many characters to obtain
This method returns a string.
23. Example
string course = "CS 143";
int blankPos;
blankPos = course.find(" "); // blankPos = 2
string subject, number;
subject = course.substr(0, blankPos); //get 2 chars
int qty = course.size() – blankPos - 1; //qty = 3
number = course.substr(blankPos + 1, qty); //get 3 chars
Character operations
The ctype library provides access to several functions for
working with characters
To access the functions you must use the directive:
#include <ctype>
FunctionDescriptionExampleisalpha(character)Returns true if
character is a letter (a-z or A-Z)isalpha('A') // true
isalpha('7') // falseisdigit(character)Returns true if character is a
digit (0-9)isdigit('A') // false
isdigit('7’) // trueisspace(character)Returns true if character is a
whitespaceisspace(' ') // true
isspace('n') // true
isspace('x') // falsetoupper(character)Returns a uppercase
version of the charactertoupper('a') //
Atolower(character)Returns a lowercase version of the
charactertolower('A') // a
Random Numbers
24. Random Numbers
Random number: an unpredictable number
-random numbers but close
enough
To generate random numbers we need functions and features
from the cstdlib header file
The rand() function:
Returns a random number between 0 and RAND_MAX
RAND_MAX is an integer constant defined in cstdlib
RAND_MAX = 32767
Random Numbers
In order to generate a random number within a given range
[upper, lower] we will use this formula:
int n = (upper–lower+1)*(rand()/(RAND_MAX+1.0))+lower;
Example: Generate random numbers between 1 and 6 (to
simulate rolling a die for example)
int n = (6 – 1 + 1) * ( rand()/(RAND_MAX+1.0) ) + 1;
int n = ( 6 ) * ( rand()/(RAND_MAX+1.0) ) + 1;
int n = 6 * [0, 0.999] + 1 ;
Note: for the example we are testing the edge cases
25. More Examples
[10, 20]
int n = (11) * (rand() / (RAND_MAX + 1.0)) + 10 ;
int n = 11 * [0, 0.999] + 10 ;
[-10, 15]
int n = (15–(-10)+1)*(rand()/(RAND_MAX+1.0))+(-10);
int n = 26 * [0, 0.999] - 10 ;
int n = 26 * 0 – -10
int n = 26 * (0.999) – –
Reproducible/Irreproducible Sequences
rand() uses an internal formula to produce random numbers
That formula has a value, called the seed, which is used to
produce the first random number.
The next random number is generated based on the first random
number.
The next random number is generated based on the previous
random number.
Consequence: for a given seed, the sequence of random
numbers is always the same.
Changing the seed
The srand(int) function allows us to change the value of the
seed.
But the value of the seed should be changed each time we run
the program.
We will use the help of the time() function from the ctime
26. library:
time(0) returns the number of seconds that have passed since
January 1, 1970 0:0:0 GMT and the machine’s current time.
int seed = static cast<int>( time(0) ) ;
srand(seed)
Example
#include <ctime>
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
int seed = static_cast<int>( time( 0 ));
srand( seed );
cout << "Here is a sequence of 5 random numbers: ";
for (int i = 1; i <= 5 ; i++)
cout << rand() << " " ;
return 0;
}
Enumerated Types
27. Enumerated types
The enum command allows us to create simple new data types
Types created with enum have a limited set of values (or
names).
These values are really nothing more than const ints, so it's
common practice to write them all in caps.
Once the new type is created, it behaves (more or less) like any
other type.
You create variables of that type and assign it values from the
list.
Declaring Enumerated Types
The generic format of enum is:
enum TypeName {value1, value2, value3, ... };
Examples:
enum Direction {NORTH, SOUTH, EAST, WEST};
enum Color {RED, BLUE, YELLOW, BLACK, WHITE};
enum Season {FALL, WINTER, SPRING, SUMMER};
Note that each value is an identifier, not a string.
By convention an enumerated type is named with the first letter
of each word capitalized and a value of an enumerated type is
named like a constant with all uppercase letters.
Declaring variables
Once a type is defined, you can declare a variable of that type:
Season current;
The variable forward can hold one of the values defined in the
enumerated type.
current = WINTER;
28. As with any other type, you can declare and initialize a variable
in one statement:
Season current = WINTER;
Enumerated values
Enumerated values are stored as integers in memory.
By default the values correspond to 0, 1, 2….., in order of their
appearance in the list.
Example:
enum Season {FALL, WINTER, SPRING, SUMMER};
FALL corresponds to the integer value 0, WINTER to 1,
SPRING to 2, and SUMMER to 3.
Enumerated values
You can explicitly assign an enumerated value with any integer
value.
Example:
enum Season {FALL = 20, WINTER = 30,
SPRING = 40, SUMMER = 50};
If you assign integer values for some values in the enumerated
type declaration, the other values will receive default values.
Example:
enum Season {FALL, WINTER, SPRING = 40, SUMMER};
FALL corresponds to the integer value 0, WINTER to 1,
SPRING to 40, and SUMMER to 41.
29. Manipulating enumerated types
One popular way of manipulating a variable of an enumerated
type is with the switch statement.
Example:
switch (current)
{
case FALL:
//process FALL
break;
case WINTER:
//process WINTER
break;
…etc…
}
What the new type can do
Simple Assignment
Season current = WINTER ;
current = SPRING ;
Season next = current ;
Simple Comparison (== and !=)
if (forward == sunrise)
cout << "You watch an inspiring sunrise." << endl;
What the new type can do, cont.
30. Used in functions as parameters and return values.
Season next_season (season current)
{
switch (current)
{
case FALL:
return WINTER;
case WINTER:
return SPRING;
case SPRING:
return SUMMER;
case SUMMER:
return FALL;
}
}
What the new type cannot do
Other math operators do not make sense:
Season current = WINTER;
current = current * 10 ;
Comparison based on inequality (<, <=, >. >=) works, but is
often meaningless:
Season next = SPRING ;
if (current >= next )
Produce meaningful output using <<:
cout << "This is the " << current << " season";
//This line produces output such as "This is the 0 season"
31. Helper functions
One way to work around the issue with output operator is to use
a helper function
string season_name (Season s)
{
switch (s)
{
case FALL:
return "Fall";
case WINTER:
return "Winter";
case SPRING:
return "Spring";
case SUMMER:
return "Summer";
}
}
cout << "This is the " << season_name(current) << " season";
CS 143 Final Exam
Date:Tuesday March 15, 2016
Time:3:30 PM – 5:30 PM
Room:Disque 103
Bring:
your Drexel student ID
If you do not bring your Drexel ID I will not accept your exam.
Pen/pencil/eraser
Study guide available in Learn
Problets available to study for the final
32. Assignments for this week
Lab 9 is due at the end of the lab session or by Friday 11:59 PM
at the latest.
Hard deadline: you and your partner will not be able to submit
after the deadline.
Lab must be submitted via Bb Learn. Submissions via email will
not be accepted or graded
Submit the source code as a cpp file. No other formats will be
graded.
CodeLab assignment # 9:
Due on Tuesday, March 15 by 11:59 PM
Submit your proof of completion via Bb Learn
Hard deadline: your answers will not be recorded after the
deadline.
zyBook Chapter 7: Participation and Challenge Activities
Due on Monday March 15 by 11:59 PM
Hard deadline: late submissions will not be graded
CS 143 Laboratory Exercise 9
Purpose:
The purpose of this lab is to gain practical experience with
strings, random number, and
enumerated types.
Contents:
33. I. Startup
II. Course Evaluation
III. String and Character manipulation
IV. Random Numbers and enumerated types
I. Startup:
You will work with your lab partner to find the solutions to the
proposed problems. At the
end of the lab session your group should submit the code your
write today via Drexel Learn.
Only one submission per group is required. Make sure you and
your partner agree on who
will be responsible for submitting your lab assignment for this
week.
Note: It is important that both partners participate in the
programming process for
the entire assignment. One student shouldn't hog the machine,
or bully the others into
doing things a certain way. Try to act professional when
working with your partners - treat
them with the respect of knowledgeable co-workers on a job.
II. Course Evaluation:
Please take a few minutes to complete the College of Computing
and Informatics course
evaluation form. The form is available at:
https://cci.drexel.goaefis.net/index.cfm
Each student must complete the course evaluation form before
34. starting the lab exercise.
NOTE: The completion of the course evaluation form is part of
you grade for this lab, so
please make sure you show the lab instructor that you completed
the evaluation form. We
will make a list of the students who complete the evaluation so
they can receive full
credit for the lab.
III. String and Character manipulation:
Start up a new project for today’s lab. If you are working on
one of the classroom
laptops, it’s recommended that you save your project in the
Desktop.
Add the following header comment at the top of the file:
//Lab Assignment #9, Characters and Strings manipulation
//Program Name:
//Purpose of the program:
//Authors: Your and your partner’s names
//Date: write today’s date
Write a program that will check a new password and make sure
it’s valid. The program
will start by asking the user to enter his/her full name (as one
string that is, the full name
must be store in one string variable), and then his/her login ID
(also a string variable).
Then the program as the user to enter a new password and
35. validates it. Here is the criteria
for valid passwords:
following four categories:
– Z).
– z).
– 9).
-alphabetic characters (for example: @ # $ % ^ & * - + =
| { ] ? / etc.).
by the last name initial)
If the password entered by the user meets the all criteria the
program let’s the user know
that the password has been changed. If the password entered
does not meet at least one of
the criteria, the program issues an error message and ask the
user to try again (as many
time as needed unti lthe user provides a valid password).
You should consider writing functions to solve this problem,
othewise you may end up
36. with a very long main function.
Here is a typical sample run for the program:
IV. Random Numbers and enumerated types:
Remove the current cpp file from the project, following these
steps:
1) In the
Solution
Explorer, find the Source Files folder and then your cpp file.
2) Right-click on the name of your cpp file. You will see a
menu pop-up. Pick the
Remove option. You will see a confirmation window. Click on
the Remove button.
3) Now add a New Item, by right-clicking the Source File folder
and then Add New
Item
37. 4) At Add New Item dialog box select C++ File (.cpp)). Give
this file a name and then
click on the Add button.
Your source code must include the following header comment at
the top of the file:
//Lab Assignment #9, Random Numbers and enumerated types
//Program Name:
//Purpose of the program:
//Authors: Your and your partner’s names
//Date: write today’s date
For this part of the lab we are going to implement a simple
guessing game that the user
can play against the computer. Start by creating an enumerated
type to represent fruits
(have at least 10 fruits of your choice listed). Generate a
random number between 0 and
9 – this number will be used to access a “random” fruit from the
list. This will be the
computer choice. The program will ask the user to guess the
name of the fruit the
38. computer has picked. The user then enters a guess. If the user
is right he/she wins.
Otherwise the computer wins. The user can play as many times
as he/she wants. Once
the user decides to quit the game, display the tally, that is, the
number of times the
computer won and the number of times the player won.
This program must be implemented using enumerated types.
You must write at least two
functions: One to handle the input of a fruit as an enumerated
type; and one to handle the
display of a fruit name. Here is a typical sample run for the
program:
Submitting your lab work
For today’s lab your group must submit the .cpp files for the
programs you wrote
today. Please make sure you upload and submit your files via
39. Drexel Learn by the
end of the lab session, or by Friday at 11:59 PM at the latest.
Submissions via email will
not be graded.
For the programs: Do not copy and paste you code in a Word
file (or any other type of
document). Only cpp files will be read and graded.