Skip to content
Snippets Groups Projects
Commit f47c9b4e authored by Rudi Buss's avatar Rudi Buss
Browse files

Umbenennungen

parent 05c376d8
No related branches found
No related tags found
No related merge requests found
Showing
with 163 additions and 142 deletions
#include <iostream>
using namespace std;
int main()
{
cout << "Willkommen bei der Bauernhofverwaltung" << endl;
system("PAUSE"); /*Compilerabhängig, evtl. auch getchar(); oder cin.ignore(); und dann cin.get(); oder es kann entfallen */
return 0;
};
\ No newline at end of file
#include <iostream>
using namespace std;
int main()
{
cout << "Vorname: Max" << endl;
cout << "Nachname: Mustermann" << endl;
cout << "Alter: 21" << endl;
cout << "Vorname: Erika" << endl << "Nachname: Engel " << endl << "Alter: 18" << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "Welcome to the farm management" << endl;
system("PAUSE"); /* Depending on the compiler perhaps also getchar(); or cin.ignore(); and then cin.get(); or it can be omitted */
return 0;
};
\ No newline at end of file
#include <iostream>
using namespace std;
int main()
{
cout << "First Name: Max" << endl;
cout << "Last Name: Mustermann" << endl;
cout << "Age: 21" << endl;
cout << "First Name: Erika" << endl << "Last Name: Engel " << endl << "Age: 18" << endl;
return 0;
}
Liebe Kursteilnehmer,
parallel zum Kurs möchte ich mit Ihnen gemeinsam in
wöchentlichen Schritten ein kleines Programm entwickeln.
Sie können so den erlernten Stoff gleich einüben.
Ich werde am Ende der Woche meinen Lösungsvorschlag ins LMS stellen.
Hier die erste Aufgabe:
Bauer Max hat einen Bauernhof mit Enten und Schweinen. Diese will er verkaufen.
Schreiben Sie ein C++-Programm, das den Nutzer am Bauernhof begrüßt.
Grüße
Monika Eberle
\ No newline at end of file
Erstellen Sie ein Programm, welches folgende Ausgabe erzeuegen soll:
Vorname: Max
Nachname: Mustermann
Alter: 21
Vorname, Nachname und Alter soll jeweils durch eine eigenen Anweisung ausgegeben werden.
Erstellen Sie zusätzlich folgende Ausgabe:
Vorname: Erika
Nachname: Engel
Alter: 18
Diese Ausgabe soll in einer einzigen Anweisung erzeugt werden.
\ No newline at end of file
Dear course participants,
along with the course, I would like to work with you on
a small program every week.
In this way, you can practice the content you have learned right away.
At the end of the week I will submit my solution to the exercise online.
Here is the first exercise:
Farmer Max has a farm with ducks and pigs. He wants to sell them.
Write a C++ program that welcomes the user to the farm.
Regards,
Rudi Buss
\ No newline at end of file
Write a program that generates the following output:
First Name: Max
Last Name: Mustermann
Age: 21
First Name, Last Name und Age should each be output by a separate statement.
In addition, generate the following output:
First Name: Erika
Last Name: Engel
Age: 18
First Name, Last Name and Age should be output in a single statement.
\ No newline at end of file
#include <iostream>
using namespace std;
int main()
{
int zahl = 21;
float kommazahl = 3.14;
string zeichenkette = "Hallo Welt";
char zeichen = 'A';
bool wahl = true;
cout << zahl << endl;
cout << kommazahl << endl;
cout << zeichenkette << endl;
cout << zeichen << endl;
cout << wahl << endl;
return 0;
};
#include <iostream>
using namespace std;
int main()
{
int Gewicht=0;
float Tagespreis=0;
float Einnahme=0;
cout << "Wie ist das Gewicht? " << endl;
cin >> Gewicht;
cout << "Wie steht der Tagespreis? " << endl;
cin >> Tagespreis;
Einnahme = Gewicht*Tagespreis;
cout << "Einnahme: " << Einnahme << endl;
cout << endl << endl;
return 0;
}
......@@ -7,16 +7,16 @@ int main()
float fahrenheit;
float celsius;
const int value = 32;
const int wert = 32;
cout << "Hello. Please insert a value (in Fahrenheit): ";
cout << "Hallo. Bitte Wert eingeben: ";
cin >> fahrenheit;
cout << endl << "The input was: " << fahrenheit;
cout << endl << "Eingabe war: " << fahrenheit;
celsius = ((fahrenheit - value) * 5) / 9;
celsius = ((fahrenheit - wert) * 5) / 9;
cout << endl;
cout << "The temperature in degree Celsius is: " << celsius;
cout << "Wert in Celsius: " << celsius;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int number = 21;
float floatingNumber = 3.14;
string AString = "Hello World";
char ACharacter = 'A';
bool choice = true;
cout << number << endl;
cout << floatingNumber << endl;
cout << AString << endl;
cout << ACharacter << endl;
cout << choice << endl;
return 0;
};
#include <iostream>
using namespace std;
int main()
{
int weight=0;
float dailyPrice=0;
float revenue=0;
cout << "What is the weight? " << endl;
cin >> weight;
cout << "What is the daily price? " << endl;
cin >> dailyPrice;
revenue = weight*dailyPrice;
cout << "Revenue: " << revenue << endl;
cout << endl << endl;
return 0;
}
Machen Sie sich mit den einzelnen Datentypen vertraut.
Erstellen Sie für jeden Punkt eine Variable mit dem passenden Datentyp:
- Ganzzahl
- Dezimalzahl
- Zeichenkette bzw. Text
- Zeichen bzw. Buchstabe
- Wahrheitswert
Weisen Sie Ihnen einen Wert zu und geben sie anschließend diese Werte auf dem Bildschirm aus.
Bauer Max will ein Schwein verkaufen.
Ergänzen Sie Ihr Programm aus Kapitel 1 "Uebung 1 - Bauernhof" um folgende Variablen:
- Gewicht
- Tagespreis
- Einnahme
In der Variablen Gewicht (Ganzzahl) soll das Gewicht des zu verkaufenden Schweins gespeichert werden.
In der Variable Tagespreis (Dezimalzahl) soll der Tagespreis für das Schwein gespeichert werden.
Beide Variablen werden im Dialog vom Nutzer über die Konsole eingegeben.
Die Einnahme errechnet sich dann aus Gewicht * Tagespreis.
Geben Sie die Höhe der Einnahme auf dem Bildschirm aus.
Wir planen eine Amerikareise. Jedoch sind dort Temperatur, Entfernung und Währung anders als in Deutschland.
Um uns die Planung zu erleichtern, wollen wir ein Programm schreiben, welches uns die Temperatur von Fahrenheit in Celsius umrechnet.
Die Formel für die Umrechnung lautet: Celsius = ((temperatur_fahrenheit - 32)*5)/9
Es gilt folgende Anforderungen umzusetzen:
1. Begrüßung und Eingabe der Temperatur in Fahrenheit
2. Ausgabe der eingegebenen Temperatur in Fahrenheit
3. Umrechnung, wobei die 32 aus der Formel als Konstante deklariert wird und mit dieser Konstanten die Umrechnung erfolgen soll.
5/9 soll in der Formel stehen bleiben.
4. Ausgabe der Temperatur in Celsius
Get familiar with the different data types.
Create a variable with the corresponding data type for each of the following bullet points:
- Integer
- Decimal number
- String or text
- Character
- Boolean value
Assign a value to the variables and then display them on the screen.
Farmer Max wants to sell a pig.
Add the following variables to your program from Chapter 1 "Exercise 1 - Farm":
¥ weight
¥ dailyPrice
¥ revenue
The variable weight (integer) should be used to store the weight of the pig.
The variable dailyPrice (decimal number) should be used to store the daily price of the pig.
Both variables are to be entered in a dialog with the user via the console.
The revenue is then calculated from weight * daily price.
Print the revenue on the screen.
We are planning a trip to America. The units for temperature, distance and currency in America are different from the units used in Germany.
In order to facilitate our planning, we want to write a program that converts the temperature from Fahrenheit to Celsius.
The conversion formula is as follows: Celsius = ((temperature_fahrenheit - 32)*5)/9
The following requirements have to be met:
1. Welcome the user, input of temperature in Fahrenheit
2. Output of the entered temperature in Fahrenheit
3. Conversion from Fahrenheit to Celsius. The 32 in the formula is to be declared as a constant, this constant should also be used for the conversion.
5/9 should remain in the formula.
4. Output of the temperature in Celsius
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment